diff --git a/lib/good_job/notifier/process_heartbeat.rb b/lib/good_job/notifier/process_heartbeat.rb index 45a1d9134..942298ed1 100644 --- a/lib/good_job/notifier/process_heartbeat.rb +++ b/lib/good_job/notifier/process_heartbeat.rb @@ -21,9 +21,11 @@ def register_process end def refresh_process - GoodJob::Process.with_connection(connection) do - Process.logger.silence do - @process&.refresh_if_stale(cleanup: true) + Rails.application.executor.wrap do + GoodJob::Process.with_connection(connection) do + GoodJob::Process.logger.silence do + @process&.refresh_if_stale(cleanup: true) + end end end end