Skip to content

Commit 1eee0e3

Browse files
committed
Check the specific method existance for Spring after_fork
There are gems that open Spring module to register new commands so checking defined?(Spring) returns truthy value but in fact there is no real Spring loaded, therefore there is exception when an application is run without Spring.
1 parent d3b30b0 commit 1eee0e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rails_semantic_logger/engine.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class Engine < ::Rails::Engine
189189
Resque.after_fork { |_job| ::SemanticLogger.reopen } if defined?(Resque)
190190

191191
# Re-open appenders after Spring has forked a process
192-
Spring.after_fork { |_job| ::SemanticLogger.reopen } if defined?(Spring)
192+
Spring.after_fork { |_job| ::SemanticLogger.reopen } if defined?(Spring.after_fork)
193193
end
194194
end
195195
end

0 commit comments

Comments
 (0)