mirror of
https://github.com/tubearchivist/tubearchivist
synced 2024-11-02 09:41:07 +00:00
fix killing task with missing task id
This commit is contained in:
parent
e202265a5f
commit
567e9d473b
@ -138,7 +138,9 @@ def run_restore_backup():
|
|||||||
|
|
||||||
def kill_dl(task_id):
|
def kill_dl(task_id):
|
||||||
"""kill download worker task by ID"""
|
"""kill download worker task by ID"""
|
||||||
|
if task_id:
|
||||||
app.control.revoke(task_id, terminate=True)
|
app.control.revoke(task_id, terminate=True)
|
||||||
|
|
||||||
_ = RedisArchivist().del_message("dl_queue_id")
|
_ = RedisArchivist().del_message("dl_queue_id")
|
||||||
RedisQueue("dl_queue").clear()
|
RedisQueue("dl_queue").clear()
|
||||||
|
|
||||||
|
@ -588,6 +588,9 @@ class PostData:
|
|||||||
RedisQueue("dl_queue").clear()
|
RedisQueue("dl_queue").clear()
|
||||||
elif to_execute == "kill":
|
elif to_execute == "kill":
|
||||||
task_id = RedisArchivist().get_message("dl_queue_id")
|
task_id = RedisArchivist().get_message("dl_queue_id")
|
||||||
|
if not task_id["status"]:
|
||||||
|
task_id = False
|
||||||
|
else:
|
||||||
print("brutally killing " + task_id)
|
print("brutally killing " + task_id)
|
||||||
kill_dl(task_id)
|
kill_dl(task_id)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user