Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributed scheduler via cron tasks? #281

Closed
elidhu opened this issue Mar 26, 2024 · 2 comments
Closed

Distributed scheduler via cron tasks? #281

elidhu opened this issue Mar 26, 2024 · 2 comments

Comments

@elidhu
Copy link

elidhu commented Mar 26, 2024

Will the cron task scheduler coordinate with multiple instances of the app? Or will I end up with duplicates?

is there a way to cancel the scheduled tasks?

Thank you!

@geofmureithi
Copy link
Owner

Unfortunately no. Multiple cron instances will run multiple jobs. There are several ways to work around this:

  1. Run a separate bin for cron and then push to a backend like postgres/redis
  2. Use a distributed lock eg Redis DLM
  3. If you are using sql eg postgres, you can manually write an insert sql command and use the execution time as the jobid. Apalis uses ulid which should make it easy and would prevent conflicts.

Let me know if that helps.

@geofmureithi
Copy link
Owner

Regarding cancelling scheduled tasks, you should just delete the record before its execution time. This is not possible for cron though.

Repository owner locked and limited conversation to collaborators Apr 4, 2024
@geofmureithi geofmureithi converted this issue into discussion #288 Apr 4, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants