FIX: autoload lib/ path for Sidekiq (#8147)

Discussed here: https://meta.discourse.org/t/sidekiq-fails-to-start-after-zeitwerk-on-docker-dev/130031/13
This commit is contained in:
Krzysztof Kotlarek 2019-10-03 09:54:36 +10:00 committed by Sam
parent 1c3cbbe883
commit 8c7568bd0c
1 changed files with 1 additions and 3 deletions

View File

@ -99,6 +99,7 @@ module Discourse
config.autoload_paths += Dir["#{config.root}/app"] config.autoload_paths += Dir["#{config.root}/app"]
config.autoload_paths += Dir["#{config.root}/app/jobs"] config.autoload_paths += Dir["#{config.root}/app/jobs"]
config.autoload_paths += Dir["#{config.root}/app/serializers"] config.autoload_paths += Dir["#{config.root}/app/serializers"]
config.autoload_paths += Dir["#{config.root}/lib"]
config.autoload_paths += Dir["#{config.root}/lib/active_record/connection_adapters"] config.autoload_paths += Dir["#{config.root}/lib/active_record/connection_adapters"]
config.autoload_paths += Dir["#{config.root}/lib/common_passwords"] config.autoload_paths += Dir["#{config.root}/lib/common_passwords"]
config.autoload_paths += Dir["#{config.root}/lib/highlight_js"] config.autoload_paths += Dir["#{config.root}/lib/highlight_js"]
@ -107,9 +108,6 @@ module Discourse
Rails.autoloaders.main.ignore(Dir["#{config.root}/app/models/reports"]) Rails.autoloaders.main.ignore(Dir["#{config.root}/app/models/reports"])
if !Sidekiq.server?
config.autoload_paths += Dir["#{config.root}/lib"]
end
# Only load the plugins named here, in the order given (default is alphabetical). # Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named. # :all can be used as a placeholder for all plugins not explicitly named.