Store the last time the repository have been verified

parent b304d82e
...@@ -73,6 +73,7 @@ module Geo ...@@ -73,6 +73,7 @@ module Geo
registry.update!( registry.update!(
"#{type}_verification_checksum_sha" => checksum, "#{type}_verification_checksum_sha" => checksum,
"#{type}_checksum_mismatch" => mismatch, "#{type}_checksum_mismatch" => mismatch,
"last_#{type}_verification_ran_at" => Time.now,
"last_#{type}_verification_failure" => failure, "last_#{type}_verification_failure" => failure,
"#{type}_verification_retry_count" => verification_retry_count, "#{type}_verification_retry_count" => verification_retry_count,
"resync_#{type}" => reverify, "resync_#{type}" => reverify,
......
...@@ -49,6 +49,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do ...@@ -49,6 +49,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do
expect(registry).to have_attributes( expect(registry).to have_attributes(
"#{type}_verification_checksum_sha" => '62fc1ec4ce60', "#{type}_verification_checksum_sha" => '62fc1ec4ce60',
"#{type}_checksum_mismatch" => false, "#{type}_checksum_mismatch" => false,
"last_#{type}_verification_ran_at" => be_within(1.minute).of(Time.now),
"last_#{type}_verification_failure" => nil, "last_#{type}_verification_failure" => nil,
"#{type}_verification_retry_count" => nil, "#{type}_verification_retry_count" => nil,
"resync_#{type}" => false, "resync_#{type}" => false,
...@@ -67,6 +68,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do ...@@ -67,6 +68,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do
expect(registry).to have_attributes( expect(registry).to have_attributes(
"#{type}_verification_checksum_sha" => '0000000000000000000000000000000000000000', "#{type}_verification_checksum_sha" => '0000000000000000000000000000000000000000',
"#{type}_checksum_mismatch" => false, "#{type}_checksum_mismatch" => false,
"last_#{type}_verification_ran_at" => be_within(1.minute).of(Time.now),
"last_#{type}_verification_failure" => nil, "last_#{type}_verification_failure" => nil,
"#{type}_verification_retry_count" => nil, "#{type}_verification_retry_count" => nil,
"resync_#{type}" => false, "resync_#{type}" => false,
...@@ -86,6 +88,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do ...@@ -86,6 +88,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do
expect(registry).to have_attributes( expect(registry).to have_attributes(
"#{type}_verification_checksum_sha" => nil, "#{type}_verification_checksum_sha" => nil,
"#{type}_checksum_mismatch" => true, "#{type}_checksum_mismatch" => true,
"last_#{type}_verification_ran_at" => be_within(1.minute).of(Time.now),
"last_#{type}_verification_failure" => "#{type.to_s.capitalize} checksum mismatch", "last_#{type}_verification_failure" => "#{type.to_s.capitalize} checksum mismatch",
"#{type}_verification_retry_count" => 1, "#{type}_verification_retry_count" => 1,
"resync_#{type}" => true, "resync_#{type}" => true,
...@@ -118,6 +121,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do ...@@ -118,6 +121,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do
expect(registry).to have_attributes( expect(registry).to have_attributes(
"#{type}_verification_checksum_sha" => nil, "#{type}_verification_checksum_sha" => nil,
"#{type}_checksum_mismatch" => false, "#{type}_checksum_mismatch" => false,
"last_#{type}_verification_ran_at" => be_within(1.minute).of(Time.now),
"last_#{type}_verification_failure" => "Error calculating #{type} checksum", "last_#{type}_verification_failure" => "Error calculating #{type} checksum",
"#{type}_verification_retry_count" => 1, "#{type}_verification_retry_count" => 1,
"resync_#{type}" => true, "resync_#{type}" => true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment