[feat]release db.session connection before workflow new thread long time operation

pull/21726/head
李强04 11 months ago
parent 18757d07c9
commit 33f91d011a

@ -219,6 +219,9 @@ class WorkflowAppGenerator(BaseAppGenerator):
# new thread with request context and contextvars # new thread with request context and contextvars
context = contextvars.copy_context() context = contextvars.copy_context()
# release database connection, because the following new thread operations may take a long time
db.session.close()
worker_thread = threading.Thread( worker_thread = threading.Thread(
target=self._generate_worker, target=self._generate_worker,
kwargs={ kwargs={

Loading…
Cancel
Save