mirror of
https://github.com/tubearchivist/tubearchivist
synced 2024-11-02 09:41:07 +00:00
handle on_failure task callback
This commit is contained in:
parent
33b9a012d4
commit
2bc92c9095
@ -111,6 +111,9 @@ class BaseTask(Task):
|
|||||||
def on_failure(self, exc, task_id, args, kwargs, einfo):
|
def on_failure(self, exc, task_id, args, kwargs, einfo):
|
||||||
"""callback for task failure"""
|
"""callback for task failure"""
|
||||||
print(f"{task_id} Failed callback")
|
print(f"{task_id} Failed callback")
|
||||||
|
message, key = self._build_message(level="error")
|
||||||
|
message.update({"messages": ["Task failed"]})
|
||||||
|
RedisArchivist().set_message(key, message, expire=20)
|
||||||
|
|
||||||
def on_success(self, retval, task_id, args, kwargs):
|
def on_success(self, retval, task_id, args, kwargs):
|
||||||
"""callback task completed successfully"""
|
"""callback task completed successfully"""
|
||||||
|
Loading…
Reference in New Issue
Block a user