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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
5f9f6ca3
Commit
5f9f6ca3
authored
Dec 20, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ExclusiveLease to ClearShareRunnerMinutesWorker
parent
9064a33a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
app/views/shared/_shared_runners_minutes_limit.html.haml
app/views/shared/_shared_runners_minutes_limit.html.haml
+1
-1
app/workers/clear_shared_runner_minutes_worker.rb
app/workers/clear_shared_runner_minutes_worker.rb
+11
-0
lib/api/entities.rb
lib/api/entities.rb
+0
-1
No files found.
app/views/shared/_shared_runners_minutes_limit.html.haml
View file @
5f9f6ca3
...
...
@@ -6,7 +6,7 @@
can?(current_user, :create_pipeline, project)
.shared-runner-quota-message.alert.alert-warning.hidden-xs
=
namespace
.
name
has exceeded
their
build minutes quota. Pipelines will not run anymore on shared runners.
has exceeded
its
build minutes quota. Pipelines will not run anymore on shared runners.
.pull-right
=
link_to
"Don't show again this month"
,
'#'
,
class:
'hide-shared-runner-limit-message-one-month alert-link'
...
...
app/workers/clear_shared_runner_minutes_worker.rb
View file @
5f9f6ca3
class
ClearSharedRunnerMinutesWorker
LEASE_TIMEOUT
=
3600
include
Sidekiq
::
Worker
include
CronjobQueue
def
perform
return
unless
try_obtain_lease
ProjectMetrics
.
update_all
(
shared_runners_minutes:
0
,
shared_runners_minutes_last_reset:
Time
.
now
)
...
...
@@ -11,4 +15,11 @@ class ClearSharedRunnerMinutesWorker
shared_runners_minutes:
0
,
shared_runners_minutes_last_reset:
Time
.
now
)
end
private
def
try_obtain_lease
Gitlab
::
ExclusiveLease
.
new
(
'gitlab_clear_shared_runner_minutes_worker'
,
timeout:
LEASE_TIMEOUT
).
try_obtain
end
end
lib/api/entities.rb
View file @
5f9f6ca3
...
...
@@ -113,7 +113,6 @@ module API
expose
:request_access_enabled
expose
:only_allow_merge_if_all_discussions_are_resolved
expose
:approvals_before_merge
expose
:shared_runners_minutes_limit
end
class
Member
<
UserBasic
...
...
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