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
15b47e27
Commit
15b47e27
authored
May 11, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Geo::RepositoryBackfilService to Geo::RepositorySyncService
parent
375f3438
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
app/services/geo/repository_sync_service.rb
app/services/geo/repository_sync_service.rb
+3
-3
spec/services/geo/repository_sync_service_spec.rb
spec/services/geo/repository_sync_service_spec.rb
+3
-3
No files found.
app/services/geo/repository_
backfill
_service.rb
→
app/services/geo/repository_
sync
_service.rb
View file @
15b47e27
module
Geo
module
Geo
class
Repository
Backfill
Service
class
Repository
Sync
Service
attr_reader
:project_id
attr_reader
:project_id
LEASE_TIMEOUT
=
8
.
hours
.
freeze
LEASE_TIMEOUT
=
8
.
hours
.
freeze
LEASE_KEY_PREFIX
=
'repository_
backfill
_service'
.
freeze
LEASE_KEY_PREFIX
=
'repository_
sync
_service'
.
freeze
def
initialize
(
project_id
)
def
initialize
(
project_id
)
@project_id
=
project_id
@project_id
=
project_id
...
@@ -81,7 +81,7 @@ module Geo
...
@@ -81,7 +81,7 @@ module Geo
end
end
def
update_registry
(
started_at
,
finished_at
)
def
update_registry
(
started_at
,
finished_at
)
log
(
'Updating re
gistry
information'
)
log
(
'Updating re
pository sync
information'
)
registry
=
Geo
::
ProjectRegistry
.
find_or_initialize_by
(
project_id:
project_id
)
registry
=
Geo
::
ProjectRegistry
.
find_or_initialize_by
(
project_id:
project_id
)
registry
.
last_repository_synced_at
=
started_at
registry
.
last_repository_synced_at
=
started_at
registry
.
last_repository_successful_sync_at
=
finished_at
if
finished_at
registry
.
last_repository_successful_sync_at
=
finished_at
if
finished_at
...
...
spec/services/geo/repository_
backfill
_service_spec.rb
→
spec/services/geo/repository_
sync
_service_spec.rb
View file @
15b47e27
require
'spec_helper'
require
'spec_helper'
describe
Geo
::
Repository
Backfill
Service
,
services:
true
do
describe
Geo
::
Repository
Sync
Service
,
services:
true
do
let!
(
:primary
)
{
create
(
:geo_node
,
:primary
,
host:
'primary-geo-node'
)
}
let!
(
:primary
)
{
create
(
:geo_node
,
:primary
,
host:
'primary-geo-node'
)
}
subject
{
described_class
.
new
(
project
.
id
)
}
subject
{
described_class
.
new
(
project
.
id
)
}
...
@@ -106,7 +106,7 @@ describe Geo::RepositoryBackfillService, services: true do
...
@@ -106,7 +106,7 @@ describe Geo::RepositoryBackfillService, services: true do
end
end
end
end
context
'when repository was
backfill
ed successfully'
do
context
'when repository was
sync
ed successfully'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:last_repository_synced_at
)
{
5
.
days
.
ago
}
let
(
:last_repository_synced_at
)
{
5
.
days
.
ago
}
...
@@ -159,7 +159,7 @@ describe Geo::RepositoryBackfillService, services: true do
...
@@ -159,7 +159,7 @@ describe Geo::RepositoryBackfillService, services: true do
end
end
end
end
context
'when last attempt to
backfill
the repository failed'
do
context
'when last attempt to
sync
the repository failed'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let!
(
:registry
)
do
let!
(
:registry
)
do
...
...
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