Autofix Rubocop Lint/AmbiguousOperatorPrecedence (#23681)
This commit is contained in:
@ -67,6 +67,6 @@ module RateLimitHeaders
|
||||
end
|
||||
|
||||
def reset_period_offset
|
||||
api_throttle_data[:period] - request_time.to_i % api_throttle_data[:period]
|
||||
api_throttle_data[:period] - (request_time.to_i % api_throttle_data[:period])
|
||||
end
|
||||
end
|
||||
|
@ -48,7 +48,7 @@ class RateLimiter
|
||||
{
|
||||
'X-RateLimit-Limit' => @limit.to_s,
|
||||
'X-RateLimit-Remaining' => (@limit - (redis.get(key) || 0).to_i).to_s,
|
||||
'X-RateLimit-Reset' => (now + (@period - now.to_i % @period)).iso8601(6),
|
||||
'X-RateLimit-Reset' => (now + (@period - (now.to_i % @period))).iso8601(6),
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -14,7 +14,7 @@ class SystemKey < ApplicationRecord
|
||||
|
||||
before_validation :set_key
|
||||
|
||||
scope :expired, ->(now = Time.now.utc) { where(arel_table[:created_at].lt(now - ROTATION_PERIOD * 3)) }
|
||||
scope :expired, ->(now = Time.now.utc) { where(arel_table[:created_at].lt(now - (ROTATION_PERIOD * 3))) }
|
||||
|
||||
class << self
|
||||
def current_key
|
||||
|
@ -18,5 +18,5 @@ class WebauthnCredential < ApplicationRecord
|
||||
validates :external_id, uniqueness: true
|
||||
validates :nickname, uniqueness: { scope: :user_id }
|
||||
validates :sign_count,
|
||||
numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 2**63 - 1 }
|
||||
numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: (2**63) - 1 }
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ module ExponentialBackoff
|
||||
|
||||
included do
|
||||
sidekiq_retry_in do |count|
|
||||
15 + 10 * (count**4) + rand(10 * (count**4))
|
||||
15 + (10 * (count**4)) + rand(10 * (count**4))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user