Skip to content

Commit

Permalink
Fix #610
Browse files Browse the repository at this point in the history
  • Loading branch information
northeastprince committed Jan 7, 2025
1 parent df245b2 commit 796175f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/concerns/rate_limitable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def initialize(duration: nil)
class_methods do
def rate_limit(key = name, to:, within:)
around_perform do |job, block|
unless Lock.acquire(key, limit: to, duration: within) { block }
raise Limit.new(duration:)
unless Lock.acquire(key, limit: to, duration: within) { block.call }
raise Limit.new(duration: within)
end
end
end
Expand Down

0 comments on commit 796175f

Please sign in to comment.