Monkey patch Sidekiq logger
Sidekiq 3.0 initialized the logger early before we had a chance to set the logfile. Then we set a new logfile causing the old logger to be closed. Since the default logger points to stdout, it got closed causing all kinds of issues.
This commit is contained in:
parent
eb7d6083e3
commit
2d2217b677
1 changed files with 3 additions and 2 deletions
|
|
@ -11,6 +11,9 @@ if AppConfig.environment.single_process_mode? && Rails.env != "test"
|
||||||
require 'sidekiq/testing/inline'
|
require 'sidekiq/testing/inline'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def (Sidekiq::Logging).logger
|
||||||
|
defined?(@logger) ? @logger : (AppConfig.heroku? ? initialize_logger : initialize_logger(AppConfig.sidekiq_log))
|
||||||
|
end
|
||||||
|
|
||||||
Sidekiq.configure_server do |config|
|
Sidekiq.configure_server do |config|
|
||||||
config.redis = AppConfig.get_redis_options
|
config.redis = AppConfig.get_redis_options
|
||||||
|
|
@ -36,8 +39,6 @@ Sidekiq.configure_server do |config|
|
||||||
chain.add SidekiqMiddlewares::CleanAndShortBacktraces
|
chain.add SidekiqMiddlewares::CleanAndShortBacktraces
|
||||||
end
|
end
|
||||||
|
|
||||||
Sidekiq::Logging.initialize_logger AppConfig.sidekiq_log unless AppConfig.heroku?
|
|
||||||
|
|
||||||
# Set connection pool on Heroku
|
# Set connection pool on Heroku
|
||||||
database_url = ENV['DATABASE_URL']
|
database_url = ENV['DATABASE_URL']
|
||||||
if(database_url)
|
if(database_url)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue