-
Notifications
You must be signed in to change notification settings - Fork 175
Dynamic scheduled tasks #553
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,12 @@ def run | |
loop do | ||
break if shutting_down? | ||
|
||
recurring_schedule.update_scheduled_tasks.tap do |updated_tasks| | ||
if updated_tasks.any? | ||
process.update_columns(metadata: metadata.compact) | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is mixing actions at very different levels, making it aware of details it shouldn't need to know, like how to update the metadata for its registered process record, or whether the recurring schedule changed. It should change, perhaps to something like recurring_schedule.reload!
if recurring_schedule.changed?
refresh_registered_process
end And |
||
end | ||
|
||
interruptible_sleep(SLEEP_INTERVAL) | ||
end | ||
ensure | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to change names. It's clear the tasks here are static since this comes from the
recurring.yml
configuration. We don't need to rename anything here.