Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/geo/project_registry.rb')
-rw-r--r--app/models/geo/project_registry.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/models/geo/project_registry.rb b/app/models/geo/project_registry.rb
index 247bceb712c..84f996f193c 100644
--- a/app/models/geo/project_registry.rb
+++ b/app/models/geo/project_registry.rb
@@ -10,4 +10,20 @@ class Geo::ProjectRegistry < Geo::BaseRegistry
where.not(last_repository_synced_at: nil, last_repository_successful_sync_at: nil)
.where(resync_repository: false, resync_wiki: false)
end
+
+ def resync_repository?
+ resync_repository || last_repository_successful_sync_at.nil?
+ end
+
+ def resync_wiki?
+ resync_wiki || last_wiki_successful_sync_at.nil?
+ end
+
+ def repository_synced_since?(timestamp)
+ last_repository_synced_at && last_repository_synced_at > timestamp
+ end
+
+ def wiki_synced_since?(timestamp)
+ last_wiki_synced_at && last_wiki_synced_at > timestamp
+ end
end