Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
02e7e499
Commit
02e7e499
authored
Dec 09, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rubocop offense and use a symbol instead of a string
parent
8b939bfa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
app/controllers/projects/pipeline_schedules_controller.rb
app/controllers/projects/pipeline_schedules_controller.rb
+1
-1
lib/gitlab/action_rate_limiter.rb
lib/gitlab/action_rate_limiter.rb
+1
-1
No files found.
app/controllers/projects/pipeline_schedules_controller.rb
View file @
02e7e499
...
@@ -42,7 +42,7 @@ class Projects::PipelineSchedulesController < Projects::ApplicationController
...
@@ -42,7 +42,7 @@ class Projects::PipelineSchedulesController < Projects::ApplicationController
end
end
def
play
def
play
limiter
=
::
Gitlab
::
ActionRateLimiter
.
new
(
action:
'play_pipeline_schedule'
)
limiter
=
::
Gitlab
::
ActionRateLimiter
.
new
(
action:
:play_pipeline_schedule
)
if
limiter
.
throttled?
(
throttle_key
,
1
)
if
limiter
.
throttled?
(
throttle_key
,
1
)
flash
[
:alert
]
=
'You cannot play this scheduled pipeline at the moment. Please wait a minute.'
flash
[
:alert
]
=
'You cannot play this scheduled pipeline at the moment. Please wait a minute.'
...
...
lib/gitlab/action_rate_limiter.rb
View file @
02e7e499
...
@@ -16,7 +16,7 @@ module Gitlab
...
@@ -16,7 +16,7 @@ module Gitlab
value
=
0
value
=
0
Gitlab
::
Redis
::
Cache
.
with
do
|
redis
|
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
)
value
=
redis
.
incr
(
cache_key
)
redis
.
expire
(
cache_key
,
expiry_time
)
if
value
==
1
redis
.
expire
(
cache_key
,
expiry_time
)
if
value
==
1
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment