Skip to content

Commit

Permalink
Update sidekiq configuration
Browse files Browse the repository at this point in the history
Refs: #2872
  • Loading branch information
shaun-technovation committed Sep 1, 2021
1 parent 8bb71d5 commit 5157380
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,4 @@
pool = ENV.fetch("SIDEKIQ_DB_POOL_SIZE") { 25 }
ActiveRecord::Base.establish_connection "#{database_url}?pool=#{pool}"
end

config.default_retries_exhausted = -> (msg, ex) do
job_id = msg.dig('args', 0, 'job_id')

unless job_id
Sidekiq.logger.warn "Unable to get job_id in default_retries_exhausted for #{msg}: #{ex}"
return
end

if db_job = Job.find_by(job_id: job_id)
db_job.update_column(:status, "dead")
Sidekiq.logger.warn "Job id=#{db_job.id} job_id=#{job_id} for " +
"#{db_job.owner_type} id=#{db_job.owner_id} is dead"
end
end
end

0 comments on commit 5157380

Please sign in to comment.