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
4937e12e
Commit
4937e12e
authored
Mar 09, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure mirror can transition out of the started state when last_update_started_at is nil
parent
6c9cf0c0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
ee/app/models/project_mirror_data.rb
ee/app/models/project_mirror_data.rb
+2
-0
ee/changelogs/unreleased/dm-project-mirror-data-last_update_started_at-nil.yml
...sed/dm-project-mirror-data-last_update_started_at-nil.yml
+6
-0
ee/spec/models/project_mirror_data_spec.rb
ee/spec/models/project_mirror_data_spec.rb
+6
-0
No files found.
ee/app/models/project_mirror_data.rb
View file @
4937e12e
...
...
@@ -39,6 +39,8 @@ class ProjectMirrorData < ActiveRecord::Base
private
def
base_delay
(
timestamp
)
return
0
unless
self
.
last_update_started_at
duration
=
timestamp
-
self
.
last_update_started_at
(
BACKOFF_PERIOD
+
rand
(
JITTER
))
*
duration
.
seconds
...
...
ee/changelogs/unreleased/dm-project-mirror-data-last_update_started_at-nil.yml
0 → 100644
View file @
4937e12e
---
title
:
Ensure mirror can transition out of the started state when last_update_started_at
is nil
merge_request
:
author
:
type
:
fixed
ee/spec/models/project_mirror_data_spec.rb
View file @
4937e12e
...
...
@@ -76,6 +76,12 @@ describe ProjectMirrorData, type: :model do
allow
(
Gitlab
::
Mirror
).
to
receive
(
:rand
).
and_return
(
mirror_jitter
)
end
context
'when last_update_started_at is nil'
do
it
'applies transition successfully'
do
expect_next_execution_timestamp
(
mirror_data
,
timestamp
+
15
.
minutes
+
mirror_jitter
)
end
end
context
'when base delay is lower than mirror min_delay'
do
before
do
mirror_data
.
last_update_started_at
=
timestamp
-
1
.
second
...
...
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