Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Archived periodic tasks are not triggered on the scheduled run #842

Open
sgavinio opened this issue Mar 14, 2024 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@sgavinio
Copy link

sgavinio commented Mar 14, 2024

Describe the issue

Hello 馃憢

When following the advise given here: #376 to specify a fixed task ID to avoid duplicate periodic tasks when having multiple scheduler instances, for example:

task := asynq.NewTask(name, payload,  asynq.TaskID("foo"), asynq.Retention(time.Minute))
_, err := scheduler.Register("* * * * *", task)

Periodic tasks that error out are simply moved to the archived state and are never again triggered on the next schedule.

I can confirm this doesn't happen if the TaskID() option is not specified. Similar to the linked discussion above, we have the scheduler running together with the worker, and where we can have potentially any number of workers depending on the amount of available work.

The only way I've managed to get the task to start again on the next schedule is to manually delete the task (i.e. remove it from archived so it can be re-enqueued again).

We write our background tasks to be completely idempotent so simply running a failed task on the next scheduled run is perfectly fine for us.

Would there be a way to skip the failed periodic tasks from going to archived? It would be ideal if an option similar to Retention() exists (which as I understand only works for completed tasks) for archived tasks.

@sgavinio sgavinio added the enhancement New feature or request label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants