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
0e4cb898
Commit
0e4cb898
authored
Apr 04, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo: Respect retry_at when downloading artifacts
Closes #5560
parent
55a0095b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
ee/app/workers/geo/file_download_dispatch_worker.rb
ee/app/workers/geo/file_download_dispatch_worker.rb
+1
-1
ee/spec/workers/geo/file_download_dispatch_worker_spec.rb
ee/spec/workers/geo/file_download_dispatch_worker_spec.rb
+18
-2
No files found.
ee/app/workers/geo/file_download_dispatch_worker.rb
View file @
0e4cb898
...
...
@@ -79,7 +79,7 @@ module Geo
end
def
find_failed_artifact_ids
(
batch_size
:)
job_artifacts_finder
.
find_failed_job_artifacts_registries
.
limit
(
batch_size
)
job_artifacts_finder
.
find_failed_job_artifacts_registries
.
retry_due
.
limit
(
batch_size
)
.
pluck
(
:artifact_id
).
map
{
|
id
|
[
:job_artifact
,
id
]
}
end
...
...
ee/spec/workers/geo/file_download_dispatch_worker_spec.rb
View file @
0e4cb898
...
...
@@ -103,6 +103,22 @@ describe Geo::FileDownloadDispatchWorker, :geo do
subject
.
perform
end
it
'does not retry failed artifacts when retry_at is tomorrow'
do
failed_registry
=
create
(
:geo_job_artifact_registry
,
:with_artifact
,
bytes:
0
,
success:
false
,
retry_at:
Date
.
tomorrow
)
expect
(
Geo
::
FileDownloadWorker
).
not_to
receive
(
:perform_async
).
with
(
:job_artifact
,
failed_registry
.
artifact_id
)
subject
.
perform
end
it
'retries failed artifacts when retry_at is in the past'
do
failed_registry
=
create
(
:geo_job_artifact_registry
,
:with_artifact
,
success:
false
,
retry_at:
Date
.
yesterday
)
expect
(
Geo
::
FileDownloadWorker
).
to
receive
(
:perform_async
).
with
(
:job_artifact
,
failed_registry
.
artifact_id
)
subject
.
perform
end
end
# Test the case where we have:
...
...
@@ -156,7 +172,7 @@ describe Geo::FileDownloadDispatchWorker, :geo do
subject
.
perform
end
it
'does not retr
ies
failed files when retry_at is tomorrow'
do
it
'does not retr
y
failed files when retry_at is tomorrow'
do
failed_registry
=
create
(
:geo_file_registry
,
:lfs
,
file_id:
999
,
success:
false
,
retry_at:
Date
.
tomorrow
)
expect
(
Geo
::
FileDownloadWorker
).
not_to
receive
(
:perform_async
).
with
(
'lfs'
,
failed_registry
.
file_id
)
...
...
@@ -164,7 +180,7 @@ describe Geo::FileDownloadDispatchWorker, :geo do
subject
.
perform
end
it
'
does not
retries failed files when retry_at is in the past'
do
it
'retries failed files when retry_at is in the past'
do
failed_registry
=
create
(
:geo_file_registry
,
:lfs
,
file_id:
999
,
success:
false
,
retry_at:
Date
.
yesterday
)
expect
(
Geo
::
FileDownloadWorker
).
to
receive
(
:perform_async
).
with
(
'lfs'
,
failed_registry
.
file_id
)
...
...
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