瀏覽代碼

Release db.session connection before workflow new thread long time operation (#21726)

Co-authored-by: 李强04 <liqiang04@gaotu.cn>
tags/1.5.1
Qiang Lee 4 月之前
父節點
當前提交
cf2173644e
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 3 行新增0 行删除
  1. 3
    0
      api/core/app/apps/workflow/app_generator.py

+ 3
- 0
api/core/app/apps/workflow/app_generator.py 查看文件

@@ -219,6 +219,9 @@ class WorkflowAppGenerator(BaseAppGenerator):
# new thread with request context and contextvars
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(
target=self._generate_worker,
kwargs={

Loading…
取消
儲存