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
0d547890
Commit
0d547890
authored
Sep 21, 2018
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create a Geo::ResetChecksumEvent after the checksum calculation
parent
0edad945
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
ee/app/services/geo/repository_verification_primary_service.rb
...p/services/geo/repository_verification_primary_service.rb
+2
-0
ee/spec/services/geo/repository_verification_primary_service_spec.rb
...vices/geo/repository_verification_primary_service_spec.rb
+20
-0
No files found.
ee/app/services/geo/repository_verification_primary_service.rb
View file @
0d547890
...
...
@@ -9,6 +9,8 @@ module Geo
def
execute
verify_checksum
(
:repository
,
project
.
repository
)
verify_checksum
(
:wiki
,
project
.
wiki
.
repository
)
Geo
::
ResetChecksumEventStore
.
new
(
project
).
create!
end
private
...
...
ee/spec/services/geo/repository_verification_primary_service_spec.rb
View file @
0d547890
require
'spec_helper'
describe
Geo
::
RepositoryVerificationPrimaryService
do
include
EE
::
GeoHelpers
let
(
:project
)
{
create
(
:project
)
}
let
(
:repository
)
{
double
(
checksum:
'f123'
)
}
let
(
:wiki
)
{
double
(
checksum:
'e321'
)
}
...
...
@@ -142,6 +144,24 @@ describe Geo::RepositoryVerificationPrimaryService do
)
end
context
'when running on a primary node'
do
before
do
stub_primary_node
end
it
'does not create a Geo::ResetChecksumEvent event if there are no secondary nodes'
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:secondary_nodes
)
{
[]
}
expect
{
subject
.
execute
}.
not_to
change
(
Geo
::
ResetChecksumEvent
,
:count
)
end
it
'creates a Geo::ResetChecksumEvent event'
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:secondary_nodes
)
{
[
build
(
:geo_node
)]
}
expect
{
subject
.
execute
}.
to
change
(
Geo
::
ResetChecksumEvent
,
:count
).
by
(
1
)
end
end
context
'when checksum calculation fails'
do
before
do
stub_project_repository
(
project
,
repository
)
...
...
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