Skip to content

Commit

Permalink
Fix: Update sidekiq handling of report_creation
Browse files Browse the repository at this point in the history
This sets up a new capusle with a concurrency of 2,
this allows two applications to have their reports
created at the same time.  The current handling allows
5 and we saw crashes after a pause in CCMS submissions
  • Loading branch information
colinbruce committed Jan 15, 2025
1 parent f0a2f29 commit 00fd77c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/workers/reports_creator_worker.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class ReportsCreatorWorker
include Sidekiq::Worker
include Sidekiq::Status::Worker
sidekiq_options queue: :report_creator

def perform(legal_aid_application_id)
legal_aid_application = LegalAidApplication.find(legal_aid_application_id)
Expand Down
4 changes: 4 additions & 0 deletions config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

Sidekiq.configure_server do |config|
config.redis = { url: redis_url }
config.capsule("report_capsule") do |cap|
cap.concurrency = 2
cap.queues = %w[report_creator]
end

# accepts :expiration (optional)
Sidekiq::Status.configure_server_middleware config, expiration: 30.minutes.to_i
Expand Down

0 comments on commit 00fd77c

Please sign in to comment.