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

Already on GitHub? Sign in to your account

Support configuring cron schedule dynamically with a block #1051

Merged
merged 3 commits into from
Aug 29, 2023

Conversation

DanielHeath
Copy link
Contributor

@DanielHeath DanielHeath commented Aug 25, 2023

Implements #1050 (comment)

@bensheldon
Copy link
Owner

@DanielHeath I just pushed up some changes.

  • Now uses the last in-memory time the job was scheduled or the time in the database. This is necessary because the next task is scheduled before the previous task is enqueued.
  • I wish the database query could be removed altogether because it happens during the Rails initialization process and I've seen that cause autoloading deadlocks in the past... but for safety I wrapped it in a Rails.application.executor.
  • Added a few more tests

@DanielHeath
Copy link
Contributor Author

Anything else required for this to be merged?

@bensheldon bensheldon changed the title Support configuring next cron run by passing a block Support configuring cron schedule dynamically with a block Aug 29, 2023
@bensheldon bensheldon added the enhancement New feature or request label Aug 29, 2023
@bensheldon bensheldon merged commit abd7479 into bensheldon:main Aug 29, 2023
19 checks passed
@bensheldon
Copy link
Owner

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
Development

Successfully merging this pull request may close these issues.

2 participants