Skip to content

Commit 796175f

Browse files
Fix #610
1 parent df245b2 commit 796175f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/models/concerns/rate_limitable.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ def initialize(duration: nil)
1212
class_methods do
1313
def rate_limit(key = name, to:, within:)
1414
around_perform do |job, block|
15-
unless Lock.acquire(key, limit: to, duration: within) { block }
16-
raise Limit.new(duration:)
15+
unless Lock.acquire(key, limit: to, duration: within) { block.call }
16+
raise Limit.new(duration: within)
1717
end
1818
end
1919
end

0 commit comments

Comments
 (0)