Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/solid_queue/processes/runnable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Runnable
attr_writer :mode

def start
# Scheduler Lifecycle - 1 - Schedule started
boot

if running_async?
Expand Down
3 changes: 3 additions & 0 deletions lib/solid_queue/scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ class Scheduler < Processes::Base
attr_reader :recurring_schedule

after_boot :run_start_hooks
# Scheduler Lifecycle - 2 - Schedule recurreing tasks
after_boot :schedule_recurring_tasks
# Scheduler Lifecycle - 4 - Unschedule recurring tasks
before_shutdown :unschedule_recurring_tasks
before_shutdown :run_stop_hooks
after_shutdown :run_exit_hooks
Expand All @@ -28,6 +30,7 @@ def metadata

def run
loop do
# Scheduler Lifecycle - 3 - Schedule loop
break if shutting_down?

interruptible_sleep(SLEEP_INTERVAL)
Expand Down