Skip to content

Commit

Permalink
Restrict copay statement notifications to 1000 / minute (#12924)
Browse files Browse the repository at this point in the history
* Add limiter for batch processing

* Adjust limit numbers

* Move to concurrent approach

* Break out from batch

* Decrease concurrent thread count

* Revert past decrease

* Move throttle to class method

* Make static limiter

* Lint

* Lint pt 2

* Restrict copay notifications to 1000/minute
  • Loading branch information
Scott James authored Jun 7, 2023
1 parent fd2714e commit 3fe7b94
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/workers/copay_notifications/parse_new_statements_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class ParseNewStatementsJob
def self.throttle
return Sidekiq::Limiter.unlimited if Rails.env.test?

Sidekiq::Limiter.concurrent('new-copay-statements', 8, wait_timeout: 259_200,
lock_timeout: 120)
Sidekiq::Limiter.window('new-copay-statements', 1000, 60)
end

LIMITER = throttle
Expand Down

0 comments on commit 3fe7b94

Please sign in to comment.