stop task immediately it is marked finished

This commit is contained in:
doubaniux 2021-09-15 11:21:13 +02:00
parent 288bc9520f
commit 7a088d2a62

View file

@ -298,6 +298,10 @@ def sync_doufen_job(task, stop_check_func):
"""
TODO: Update task status every certain amount of items to reduce IO consumption
"""
task = SyncTask.objects.get(pk=task.pk)
if task.is_finished:
return
parser = DoufenParser(task)
items = parser.parse()