From 4547621f8660b0ae223ae8b180e32bcae1728b16 Mon Sep 17 00:00:00 2001 From: Karl Entwistle Date: Sat, 30 Nov 2024 09:30:48 +0000 Subject: [PATCH] Auto-detect SolidQueue Adds SolidQueue as an auto detected framework --- lib/rails_semantic_logger/engine.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/rails_semantic_logger/engine.rb b/lib/rails_semantic_logger/engine.rb index 8e1863e..865cf34 100644 --- a/lib/rails_semantic_logger/engine.rb +++ b/lib/rails_semantic_logger/engine.rb @@ -266,6 +266,9 @@ class Engine < ::Rails::Engine # Re-open appenders after Spring has forked a process Spring.after_fork { |_job| ::SemanticLogger.reopen } if defined?(Spring.after_fork) + # Re-open appenders after SolidQueue has forked a worker + SolidQueue.on_worker_start { ::SemanticLogger.reopen } if defined?(SolidQueue.on_worker_start) + console do |_app| # Don't use a background thread for logging SemanticLogger.sync!