You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
Recently, I run the flask rq-worker with the flask-sqlalchemy in order to do some model operations by async-task in the worker. While it occasionally raised the Error
ResourceClosedError: This result object does not return rows. It has been closed automatically.
I don't know what happen to the worker cause the issue. I could not reproduce the error and have searched for a long time on the problem. While get nothing solution on it.
I wonder if any examples on flask-rq worked with flask-sqlalchemy? Here are the code snippets my own.
if __name__ == '__main__':
with app.app_context():
QUEUE = get_queue()
worker = get_worker()
worker.push_exc_handler(retry_handler)
worker.work()
And the async task
@job
def async_restart_task(task_id):
creating_info = {"status": TaskStatus.Creating} # NOTE: Reset created_at ?
task = TaskModel.update_task(task_id, creating_info)
task = TaskModel.get_task_by_id(task_id)
service = get_service(task.service)
for jobs in iter_group(10, service.gen_jobs(task)):
JobModel.add_jobs(jobs)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Recently, I run the flask rq-worker with the flask-sqlalchemy in order to do some model operations by async-task in the worker. While it occasionally raised the Error
ResourceClosedError: This result object does not return rows. It has been closed automatically.
I don't know what happen to the worker cause the issue. I could not reproduce the error and have searched for a long time on the problem. While get nothing solution on it.
I wonder if any examples on flask-rq worked with flask-sqlalchemy? Here are the code snippets my own.
And the async task
The text was updated successfully, but these errors were encountered: