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
0d2b92d6
Commit
0d2b92d6
authored
May 25, 2020
by
Alexandru Croitor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace IMPORT_JOBS_EXPIRATION constant usage
Replace usage of IMPORT_JOBS_EXPIRATION with its original definition
parent
f5bfe560
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
9 additions
and
11 deletions
+9
-11
app/models/concerns/import_state/sidekiq_job_tracker.rb
app/models/concerns/import_state/sidekiq_job_tracker.rb
+1
-1
app/workers/concerns/project_import_options.rb
app/workers/concerns/project_import_options.rb
+1
-1
app/workers/stuck_import_jobs_worker.rb
app/workers/stuck_import_jobs_worker.rb
+0
-2
ee/app/workers/repository_update_mirror_worker.rb
ee/app/workers/repository_update_mirror_worker.rb
+1
-1
lib/gitlab/import/set_async_jid.rb
lib/gitlab/import/set_async_jid.rb
+1
-1
lib/gitlab/phabricator_import/cache/map.rb
lib/gitlab/phabricator_import/cache/map.rb
+1
-1
lib/gitlab/phabricator_import/worker_state.rb
lib/gitlab/phabricator_import/worker_state.rb
+1
-1
spec/lib/gitlab/import/set_async_jid_spec.rb
spec/lib/gitlab/import/set_async_jid_spec.rb
+1
-1
spec/lib/gitlab/phabricator_import/cache/map_spec.rb
spec/lib/gitlab/phabricator_import/cache/map_spec.rb
+1
-1
spec/workers/concerns/project_import_options_spec.rb
spec/workers/concerns/project_import_options_spec.rb
+1
-1
No files found.
app/models/concerns/import_state/sidekiq_job_tracker.rb
View file @
0d2b92d6
...
...
@@ -15,7 +15,7 @@ module ImportState
def
refresh_jid_expiration
return
unless
jid
Gitlab
::
SidekiqStatus
.
set
(
jid
,
StuckImportJobsWorker
::
IMPORT_JOBS_EXPIRATION
)
Gitlab
::
SidekiqStatus
.
set
(
jid
,
Gitlab
::
Import
::
StuckImportJob
::
IMPORT_JOBS_EXPIRATION
)
end
def
self
.
jid_by
(
project_id
:,
status
:)
...
...
app/workers/concerns/project_import_options.rb
View file @
0d2b92d6
...
...
@@ -6,7 +6,7 @@ module ProjectImportOptions
IMPORT_RETRY_COUNT
=
5
included
do
sidekiq_options
retry:
IMPORT_RETRY_COUNT
,
status_expiration:
StuckImportJobsWorker
::
IMPORT_JOBS_EXPIRATION
sidekiq_options
retry:
IMPORT_RETRY_COUNT
,
status_expiration:
Gitlab
::
Import
::
StuckImportJob
::
IMPORT_JOBS_EXPIRATION
# We only want to mark the project as failed once we exhausted all retries
sidekiq_retries_exhausted
do
|
job
|
...
...
app/workers/stuck_import_jobs_worker.rb
View file @
0d2b92d6
...
...
@@ -3,8 +3,6 @@
class
StuckImportJobsWorker
# rubocop:disable Scalability/IdempotentWorker
include
Gitlab
::
Import
::
StuckImportJob
IMPORT_JOBS_EXPIRATION
=
Gitlab
::
Import
::
StuckImportJob
::
IMPORT_JOBS_EXPIRATION
private
def
track_metrics
(
with_jid_count
,
without_jid_count
)
...
...
ee/app/workers/repository_update_mirror_worker.rb
View file @
0d2b92d6
...
...
@@ -10,7 +10,7 @@ class RepositoryUpdateMirrorWorker # rubocop:disable Scalability/IdempotentWorke
feature_category
:source_code_management
# Retry not necessary. It will try again at the next update interval.
sidekiq_options
retry:
false
,
status_expiration:
StuckImportJobsWorker
::
IMPORT_JOBS_EXPIRATION
sidekiq_options
retry:
false
,
status_expiration:
Gitlab
::
Import
::
StuckImportJob
::
IMPORT_JOBS_EXPIRATION
attr_accessor
:project
,
:repository
,
:current_user
...
...
lib/gitlab/import/set_async_jid.rb
View file @
0d2b92d6
...
...
@@ -14,7 +14,7 @@ module Gitlab
jid
=
generate_jid
(
import_state
)
Gitlab
::
SidekiqStatus
.
set
(
jid
,
StuckImportJobsWorker
::
IMPORT_JOBS_EXPIRATION
)
.
set
(
jid
,
Gitlab
::
Import
::
StuckImportJob
::
IMPORT_JOBS_EXPIRATION
)
import_state
.
update_column
(
:jid
,
jid
)
end
...
...
lib/gitlab/phabricator_import/cache/map.rb
View file @
0d2b92d6
...
...
@@ -63,7 +63,7 @@ module Gitlab
def
timeout
# Setting the timeout to the same one as we do for clearing stuck jobs
# this makes sure all cache is available while the import is running.
StuckImportJobsWorker
::
IMPORT_JOBS_EXPIRATION
Gitlab
::
Import
::
StuckImportJob
::
IMPORT_JOBS_EXPIRATION
end
end
end
...
...
lib/gitlab/phabricator_import/worker_state.rb
View file @
0d2b92d6
...
...
@@ -40,7 +40,7 @@ module Gitlab
def
timeout
# Make sure we get rid of all the information after a job is marked
# as failed/succeeded
StuckImportJobsWorker
::
IMPORT_JOBS_EXPIRATION
Gitlab
::
Import
::
StuckImportJob
::
IMPORT_JOBS_EXPIRATION
end
end
end
...
...
spec/lib/gitlab/import/set_async_jid_spec.rb
View file @
0d2b92d6
...
...
@@ -8,7 +8,7 @@ describe Gitlab::Import::SetAsyncJid do
it
'sets the JID in Redis'
do
expect
(
Gitlab
::
SidekiqStatus
)
.
to
receive
(
:set
)
.
with
(
"async-import/project-import-state/
#{
project
.
id
}
"
,
StuckImportJobsWorker
::
IMPORT_JOBS_EXPIRATION
)
.
with
(
"async-import/project-import-state/
#{
project
.
id
}
"
,
Gitlab
::
Import
::
StuckImportJob
::
IMPORT_JOBS_EXPIRATION
)
.
and_call_original
described_class
.
set_jid
(
project
.
import_state
)
...
...
spec/lib/gitlab/phabricator_import/cache/map_spec.rb
View file @
0d2b92d6
...
...
@@ -66,7 +66,7 @@ describe Gitlab::PhabricatorImport::Cache::Map, :clean_gitlab_redis_cache do
end
expect
(
set_data
).
to
eq
({
classname:
'Issue'
,
database_id:
issue
.
id
.
to_s
})
expect
(
ttl
).
to
be_within
(
1
.
second
).
of
(
StuckImportJobsWorker
::
IMPORT_JOBS_EXPIRATION
)
expect
(
ttl
).
to
be_within
(
1
.
second
).
of
(
Gitlab
::
Import
::
StuckImportJob
::
IMPORT_JOBS_EXPIRATION
)
end
end
...
...
spec/workers/concerns/project_import_options_spec.rb
View file @
0d2b92d6
...
...
@@ -17,7 +17,7 @@ describe ProjectImportOptions do
end
it
'sets default status expiration'
do
expect
(
worker_class
.
sidekiq_options
[
'status_expiration'
]).
to
eq
(
StuckImportJobsWorker
::
IMPORT_JOBS_EXPIRATION
)
expect
(
worker_class
.
sidekiq_options
[
'status_expiration'
]).
to
eq
(
Gitlab
::
Import
::
StuckImportJob
::
IMPORT_JOBS_EXPIRATION
)
end
describe
'.sidekiq_retries_exhausted'
do
...
...
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