fix task cancling bug (#98)

This commit is contained in:
KevinHuSh
2024-03-05 16:33:47 +08:00
committed by GitHub
parent 07d76ea18d
commit 602038ac49
11 changed files with 24 additions and 15 deletions

View File

@ -73,8 +73,9 @@ class TaskService(CommonService):
@classmethod
@DB.connection_context()
def update_progress(cls, id, info):
cls.model.update(progress_msg=cls.model.progress_msg + "\n" + info["progress_msg"]).where(
cls.model.id == id).execute()
if info["progress_msg"]:
cls.model.update(progress_msg=cls.model.progress_msg + "\n" + info["progress_msg"]).where(
cls.model.id == id).execute()
if "progress" in info:
cls.model.update(progress=info["progress"]).where(
cls.model.id == id).execute()