lib/rocket_job/worker.rb in rocketjob-4.2.0 vs lib/rocket_job/worker.rb in rocketjob-4.3.0.beta
- old
+ new
@@ -117,9 +117,12 @@
job = Job.rocket_job_next_job(name, current_filter)
break unless job
SemanticLogger.named_tagged(job: job.id.to_s) do
processed = true unless job.rocket_job_work(self, false, current_filter)
+
+ # Return the database connections for this thread back to the connection pool
+ ActiveRecord::Base.clear_active_connections! if defined?(ActiveRecord::Base)
end
end
processed
end