Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mouday committed Apr 16, 2024
1 parent 9880b93 commit 5c4cb58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions domain_admin/service/async_task_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from flask import g

from domain_admin.log import logger
from domain_admin.model.base_model import db
from domain_admin.model.log_async_task_model import AsyncTaskModel
from domain_admin.utils import datetime_util

Expand Down Expand Up @@ -79,9 +80,10 @@ def done_callback(future):
'update_time': datetime_util.get_datetime(),
}

AsyncTaskModel.update(data).where(
AsyncTaskModel.id == async_task_row.id
).execute()
with db.connection_context():
AsyncTaskModel.update(data).where(
AsyncTaskModel.id == async_task_row.id
).execute()

# execute
ret = submit_task(func, *args, **kwargs)
Expand Down
1 change: 0 additions & 1 deletion domain_admin/service/scheduler_service/scheduler_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def get_monitor_task_next_run_time():
return monitor_task.next_run_time


@db.connection_context()
def run_monitor_task():
next_run_time = monitor_service.run_monitor_task()

Expand Down

0 comments on commit 5c4cb58

Please sign in to comment.