flask - Is there a way to receive a notification as soon as a certain task with a certain task id is successful or fails using Celery for Python? -
i want know if there way monitor whether or not task completes or fails using python celery. have event want fire based on results of task.
you can run task celery @shared_task
try except
block inside:
@shared_task def my_task(input1, input2, ...): setting up... try: stuff fire_success_event() <- success event except exception: above stuff failed fire_fail_event() <- fail event return 1 <- fail return 0 <- success
good luck :)
Comments
Post a Comment