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
a694ba79
Commit
a694ba79
authored
Jul 23, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
3f34fab7
d892e80b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
app/models/remote_mirror.rb
app/models/remote_mirror.rb
+2
-2
changelogs/unreleased/bvl-mark-remote-mirrors-as-failed-sooner.yml
...s/unreleased/bvl-mark-remote-mirrors-as-failed-sooner.yml
+5
-0
spec/models/remote_mirror_spec.rb
spec/models/remote_mirror_spec.rb
+12
-3
No files found.
app/models/remote_mirror.rb
View file @
a694ba79
...
...
@@ -31,7 +31,7 @@ class RemoteMirror < ApplicationRecord
scope
:enabled
,
->
{
where
(
enabled:
true
)
}
scope
:started
,
->
{
with_update_status
(
:started
)
}
scope
:stuck
,
->
{
started
.
where
(
'last_update_at < ? OR (last_update_at IS NULL AND updated_at < ?)'
,
1
.
day
.
ago
,
1
.
day
.
ago
)
}
scope
:stuck
,
->
{
started
.
where
(
'last_update_at < ? OR (last_update_at IS NULL AND updated_at < ?)'
,
1
.
hour
.
ago
,
3
.
hours
.
ago
)
}
state_machine
:update_status
,
initial: :none
do
event
:update_start
do
...
...
@@ -173,7 +173,7 @@ class RemoteMirror < ApplicationRecord
result
=
URI
.
parse
(
url
)
result
.
password
=
'*****'
if
result
.
password
result
.
user
=
'*****'
if
result
.
user
&&
result
.
user
!=
"git"
# tokens or other data may be saved as user
result
.
user
=
'*****'
if
result
.
user
&&
result
.
user
!=
'git'
# tokens or other data may be saved as user
result
.
to_s
end
...
...
changelogs/unreleased/bvl-mark-remote-mirrors-as-failed-sooner.yml
0 → 100644
View file @
a694ba79
---
title
:
Mark push mirrors as failed after 1 hour
merge_request
:
30999
author
:
type
:
changed
spec/models/remote_mirror_spec.rb
View file @
a694ba79
...
...
@@ -113,7 +113,7 @@ describe RemoteMirror, :mailer do
remote_mirror
=
create
(
:remote_mirror
)
expect
(
remote_mirror
.
remote_name
).
to
eq
(
"remote_mirror_secret"
)
expect
(
remote_mirror
.
remote_name
).
to
eq
(
'remote_mirror_secret'
)
end
end
...
...
@@ -201,11 +201,20 @@ describe RemoteMirror, :mailer do
end
context
'stuck mirrors'
do
it
'includes mirrors stuck in started with no last_update_at set'
do
it
'includes mirrors that were started over an hour ago'
do
mirror
=
create_mirror
(
url:
'http://cantbeblank'
,
update_status:
'started'
,
last_update_at:
3
.
hours
.
ago
,
updated_at:
2
.
hours
.
ago
)
expect
(
described_class
.
stuck
.
last
).
to
eq
(
mirror
)
end
it
'includes mirrors started over 3 hours ago for their first sync'
do
mirror
=
create_mirror
(
url:
'http://cantbeblank'
,
update_status:
'started'
,
last_update_at:
nil
,
updated_at:
25
.
hours
.
ago
)
updated_at:
4
.
hours
.
ago
)
expect
(
described_class
.
stuck
.
last
).
to
eq
(
mirror
)
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