BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
94716c27
Commit
94716c27
authored
Apr 06, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unnecessary lease as cron job
parent
44ec4002
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
13 deletions
+0
-13
stuck_import_jobs_worker.rb
app/workers/stuck_import_jobs_worker.rb
+0
-13
No files found.
app/workers/stuck_import_jobs_worker.rb
View file @
94716c27
...
...
@@ -2,12 +2,9 @@ class StuckImportJobsWorker
include
Sidekiq
::
Worker
include
CronjobQueue
EXCLUSIVE_LEASE_KEY
=
'fail_stuck_imports_worker_lease'
.
freeze
IMPORT_EXPIRATION
=
15
.
hours
.
to_i
def
perform
return
unless
try_obtain_lease
stuck_projects
.
find_in_batches
(
batch_size:
500
)
do
|
group
|
jids
=
group
.
map
(
&
:import_jid
)
...
...
@@ -20,8 +17,6 @@ class StuckImportJobsWorker
fail_batch!
(
completed_jids
,
completed_ids
)
end
end
remove_lease
end
private
...
...
@@ -39,12 +34,4 @@ class StuckImportJobsWorker
def
error_message
"Import timed out. Import took longer than
#{
IMPORT_EXPIRATION
}
seconds"
end
def
try_obtain_lease
@uuid
=
Gitlab
::
ExclusiveLease
.
new
(
EXCLUSIVE_LEASE_KEY
,
timeout:
30
.
minutes
).
try_obtain
end
def
remove_lease
Gitlab
::
ExclusiveLease
.
cancel
(
EXCLUSIVE_LEASE_KEY
,
@uuid
)
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