lib/good_job.rb in good_job-3.18.0 vs lib/good_job.rb in good_job-3.18.1
- old
+ new
@@ -149,9 +149,11 @@
# For example, you should use +shutdown+ and +restart+ when using async execution mode with Puma.
# See the {file:README.md#executing-jobs-async--in-process} for more explanation and examples.
# @param timeout [Numeric] Seconds to wait for active threads to finish.
# @return [void]
def self.restart(timeout: -1)
+ return if configuration.execution_mode != :async && configuration.in_webserver?
+
_shutdown_all(Capsule.instances, :restart, timeout: timeout)
end
# Sends +#shutdown+ or +#restart+ to executable objects ({GoodJob::Notifier}, {GoodJob::Poller}, {GoodJob::Scheduler}, {GoodJob::MultiScheduler}, {GoodJob::CronManager})
# @param executables [Array<Notifier, Poller, Scheduler, MultiScheduler, CronManager>] Objects to shut down.