Fix Rubocop offense and use a symbol instead of a string

This commit is contained in:
Stan Hu 2017-12-09 21:00:34 -08:00
parent 8b939bfab7
commit 02e7e499d4
2 changed files with 2 additions and 2 deletions

View File

@ -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.'

View File

@ -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