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
bc6c2a5c
Commit
bc6c2a5c
authored
Sep 14, 2021
by
Mike Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo: Alternate redownload and normal SSF sync attempts
For retries of failed syncs. Changelog: changed EE: true
parent
37faf155
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
ee/app/services/geo/framework_repository_sync_service.rb
ee/app/services/geo/framework_repository_sync_service.rb
+3
-1
ee/spec/services/geo/framework_repository_sync_service_spec.rb
...ec/services/geo/framework_repository_sync_service_spec.rb
+27
-0
No files found.
ee/app/services/geo/framework_repository_sync_service.rb
View file @
bc6c2a5c
...
@@ -245,7 +245,9 @@ module Geo
...
@@ -245,7 +245,9 @@ module Geo
def
should_be_redownloaded?
def
should_be_redownloaded?
return
true
if
registry
.
force_to_redownload
return
true
if
registry
.
force_to_redownload
registry
.
retry_count
>
RETRIES_BEFORE_REDOWNLOAD
retries
=
registry
.
retry_count
retries
.
present?
&&
retries
>
RETRIES_BEFORE_REDOWNLOAD
&&
retries
.
odd?
end
end
def
reschedule_sync
def
reschedule_sync
...
...
ee/spec/services/geo/framework_repository_sync_service_spec.rb
View file @
bc6c2a5c
...
@@ -5,6 +5,7 @@ require 'spec_helper'
...
@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Geo
::
FrameworkRepositorySyncService
,
:geo
do
RSpec
.
describe
Geo
::
FrameworkRepositorySyncService
,
:geo
do
include
::
EE
::
GeoHelpers
include
::
EE
::
GeoHelpers
include
ExclusiveLeaseHelpers
include
ExclusiveLeaseHelpers
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
...
@@ -327,4 +328,30 @@ RSpec.describe Geo::FrameworkRepositorySyncService, :geo do
...
@@ -327,4 +328,30 @@ RSpec.describe Geo::FrameworkRepositorySyncService, :geo do
end
end
end
end
end
end
describe
'#should_be_redownloaded?'
do
where
(
:force_to_redownload
,
:retry_count
,
:expected
)
do
false
|
nil
|
false
false
|
0
|
false
false
|
1
|
false
false
|
10
|
false
false
|
11
|
true
false
|
12
|
false
false
|
13
|
true
false
|
14
|
false
false
|
101
|
true
false
|
102
|
false
true
|
nil
|
true
true
|
0
|
true
true
|
11
|
true
end
with_them
do
it
"returns the expected boolean"
do
registry
.
update!
(
retry_count:
retry_count
,
force_to_redownload:
force_to_redownload
)
expect
(
subject
.
send
(
:should_be_redownloaded?
)).
to
eq
(
expected
)
end
end
end
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