Skip to content

Commit

Permalink
Wrap Scheduler task execution with Rails reloader instead of `execu…
Browse files Browse the repository at this point in the history
…tor` to avoid database connection changing during code reload (#389)
  • Loading branch information
bensheldon committed Sep 30, 2021
1 parent 1a954e5 commit c2949e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/good_job/scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def create_executor
# @return [void]
def create_task(delay = 0)
future = Concurrent::ScheduledTask.new(delay, args: [performer], executor: executor, timer_set: timer_set) do |thr_performer|
Rails.application.executor.wrap do
Rails.application.reloader.wrap do
thr_performer.next
end
end
Expand Down

0 comments on commit c2949e8

Please sign in to comment.