Fix Rubocop offense and use a symbol instead of a string
This commit is contained in:
parent
8b939bfab7
commit
02e7e499d4
|
@ -42,7 +42,7 @@ class Projects::PipelineSchedulesController < Projects::ApplicationController
|
|||
end
|
||||
|
||||
def play
|
||||
limiter = ::Gitlab::ActionRateLimiter.new(action: 'play_pipeline_schedule')
|
||||
limiter = ::Gitlab::ActionRateLimiter.new(action: :play_pipeline_schedule)
|
||||
|
||||
if limiter.throttled?(throttle_key, 1)
|
||||
flash[:alert] = 'You cannot play this scheduled pipeline at the moment. Please wait a minute.'
|
||||
|
|
|
@ -16,7 +16,7 @@ module Gitlab
|
|||
value = 0
|
||||
|
||||
Gitlab::Redis::Cache.with do |redis|
|
||||
cache_key = "action_rate_limiter:#{action.to_s}:#{key}"
|
||||
cache_key = "action_rate_limiter:#{action}:#{key}"
|
||||
value = redis.incr(cache_key)
|
||||
redis.expire(cache_key, expiry_time) if value == 1
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue