danyi1212 / celery-insights

Real-Time monitoring tool for Celery
https://celery-insights.vercel.app
BSD 3-Clause "New" or "Revised" License
51 stars 5 forks source link

[FEATURE] Option to retry a failed task #33

Closed eriktelepovsky closed 2 months ago

eriktelepovsky commented 10 months ago

Hi

Is your feature request related to a problem? Please describe. I'm always frustrated when I need to manually execute a script to retry a failed task. I know there is a possibility to setup a failover and retry strategy, but sometimes it is more suitable to retry the task immediately on demand.

Describe the solution you'd like It would be great if there is a button in the UI for the failed task to retry it. It would execute the task with the same parameters.

Describe alternatives you've considered There is a django-celery-results app alternative which I can add a custom action to retry the specific tasks, but celery-insights is much better tool. The only missing thing is the "retry button".

Additional context Snippet I currently use:

def retry_task(task_id):    
    meta = celery_app.backend.get_task_meta(task_id)
    task = celery_app.tasks[meta['name']]
    task.apply_async(args=meta['args'], kwargs=meta['kwargs'])

Thank you in advance!

danyi1212 commented 2 months ago

I'm intentionally kept Celery Insights as read-only until now. Added remote control operations such as Publish task, Revoke task, Restart worker, etc. really require some Authorization layer, and itself needing some Authentication layer.

This is rather hard to do well in a stateless container, with a simple enough setup.

Any suggestions, feature ideas or pull requests and greatly appreciated 🌟 Let's open a discussion about this topic to continue the conversation