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
363ef815
Commit
363ef815
authored
Oct 07, 2016
by
Borja Aparicio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decrease maximum time to wait for a mirror process to finish from 1 day to 2 hours
parent
e6ec9645
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
CHANGELOG-EE
CHANGELOG-EE
+1
-0
app/workers/update_all_mirrors_worker.rb
app/workers/update_all_mirrors_worker.rb
+1
-1
spec/workers/update_all_mirrors_worker_spec.rb
spec/workers/update_all_mirrors_worker_spec.rb
+4
-4
No files found.
CHANGELOG-EE
View file @
363ef815
...
@@ -4,6 +4,7 @@ v 8.13.0 (unreleased)
...
@@ -4,6 +4,7 @@ v 8.13.0 (unreleased)
- Fix 500 error updating mirror URLs for projects
- Fix 500 error updating mirror URLs for projects
- Fix validations related to mirroring settings form. !773
- Fix validations related to mirroring settings form. !773
- Fix Git access panel for Wikis when Kerberos authentication is enabled (Borja Aparicio)
- Fix Git access panel for Wikis when Kerberos authentication is enabled (Borja Aparicio)
- Decrease maximum time that GitLab waits for a mirror to finish !791 (Borja Aparicio)
v 8.12.5
v 8.12.5
- No EE-specific changes
- No EE-specific changes
...
...
app/workers/update_all_mirrors_worker.rb
View file @
363ef815
...
@@ -16,7 +16,7 @@ class UpdateAllMirrorsWorker
...
@@ -16,7 +16,7 @@ class UpdateAllMirrorsWorker
def
fail_stuck_mirrors!
def
fail_stuck_mirrors!
stuck
=
Project
.
mirror
.
stuck
=
Project
.
mirror
.
with_import_status
(
:started
).
with_import_status
(
:started
).
where
(
'mirror_last_update_at < ?'
,
1
.
day
.
ago
)
where
(
'mirror_last_update_at < ?'
,
2
.
hours
.
ago
)
stuck
.
find_each
(
batch_size:
50
)
do
|
project
|
stuck
.
find_each
(
batch_size:
50
)
do
|
project
|
project
.
mark_import_as_failed
(
'The mirror update took too long to complete.'
)
project
.
mark_import_as_failed
(
'The mirror update took too long to complete.'
)
...
...
spec/workers/update_all_mirrors_worker_spec.rb
View file @
363ef815
...
@@ -42,7 +42,7 @@ describe UpdateAllMirrorsWorker do
...
@@ -42,7 +42,7 @@ describe UpdateAllMirrorsWorker do
describe
'#fail_stuck_mirrors!'
do
describe
'#fail_stuck_mirrors!'
do
it
'ignores records that are not mirrors'
do
it
'ignores records that are not mirrors'
do
create
(
:empty_project
,
:import_started
,
mirror_last_update_at:
3
.
day
s
.
ago
)
create
(
:empty_project
,
:import_started
,
mirror_last_update_at:
12
.
hour
s
.
ago
)
expect_any_instance_of
(
Project
).
not_to
receive
(
:import_fail
)
expect_any_instance_of
(
Project
).
not_to
receive
(
:import_fail
)
...
@@ -50,7 +50,7 @@ describe UpdateAllMirrorsWorker do
...
@@ -50,7 +50,7 @@ describe UpdateAllMirrorsWorker do
end
end
it
'ignores records without in-progress import'
do
it
'ignores records without in-progress import'
do
create
(
:empty_project
,
:mirror
,
:import_finished
,
mirror_last_update_at:
3
.
day
s
.
ago
)
create
(
:empty_project
,
:mirror
,
:import_finished
,
mirror_last_update_at:
12
.
hour
s
.
ago
)
expect_any_instance_of
(
Project
).
not_to
receive
(
:import_fail
)
expect_any_instance_of
(
Project
).
not_to
receive
(
:import_fail
)
...
@@ -66,7 +66,7 @@ describe UpdateAllMirrorsWorker do
...
@@ -66,7 +66,7 @@ describe UpdateAllMirrorsWorker do
end
end
it
'transitions stuck mirrors to a failed state'
do
it
'transitions stuck mirrors to a failed state'
do
project
=
create
(
:empty_project
,
:mirror
,
mirror_last_update_at:
3
.
day
s
.
ago
)
project
=
create
(
:empty_project
,
:mirror
,
mirror_last_update_at:
12
.
hour
s
.
ago
)
perform
perform
project
.
reload
project
.
reload
...
@@ -75,7 +75,7 @@ describe UpdateAllMirrorsWorker do
...
@@ -75,7 +75,7 @@ describe UpdateAllMirrorsWorker do
end
end
it
'updates the import_error message'
do
it
'updates the import_error message'
do
project
=
create
(
:empty_project
,
:mirror
,
mirror_last_update_at:
3
.
day
s
.
ago
)
project
=
create
(
:empty_project
,
:mirror
,
mirror_last_update_at:
12
.
hour
s
.
ago
)
perform
perform
project
.
reload
project
.
reload
...
...
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