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
419a758b
Commit
419a758b
authored
Mar 17, 2020
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New repository_has_successfully_synced? method
parent
23d9ea0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
ee/app/models/geo/project_registry.rb
ee/app/models/geo/project_registry.rb
+4
-0
ee/spec/models/geo/project_registry_spec.rb
ee/spec/models/geo/project_registry_spec.rb
+18
-0
No files found.
ee/app/models/geo/project_registry.rb
View file @
419a758b
...
...
@@ -432,6 +432,10 @@ class Geo::ProjectRegistry < Geo::BaseRegistry
:synced
end
def
repository_has_successfully_synced?
last_repository_successful_sync_at
.
present?
end
private
# Whether any operation has ever been attempted
...
...
ee/spec/models/geo/project_registry_spec.rb
View file @
419a758b
...
...
@@ -1014,4 +1014,22 @@ describe Geo::ProjectRegistry do
expect
(
registry
.
synchronization_state
).
to
eq
(
:synced
)
end
end
describe
'repository_has_successfully_synced?'
do
context
'when repository has never successfully synced'
do
it
'returns false'
do
registry
=
create
(
:geo_project_registry
,
last_repository_successful_sync_at:
nil
)
expect
(
registry
.
repository_has_successfully_synced?
).
to
be_falsey
end
end
context
'when repository has successfully synced'
do
it
'returns true'
do
registry
=
create
(
:geo_project_registry
,
last_repository_successful_sync_at:
Time
.
now
)
expect
(
registry
.
repository_has_successfully_synced?
).
to
be_truthy
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