Commit fbd5a719 authored by Tiago Botelho's avatar Tiago Botelho

Change RemoteMirror#sync? to be semantically sound

parent 85ef4943
...@@ -89,11 +89,11 @@ class RemoteMirror < ActiveRecord::Base ...@@ -89,11 +89,11 @@ class RemoteMirror < ActiveRecord::Base
end end
def sync? def sync?
!enabled? enabled?
end end
def sync def sync
return if sync? return unless sync?
if recently_scheduled? if recently_scheduled?
RepositoryUpdateRemoteMirrorWorker.perform_in(backoff_delay, self.id, Time.now) RepositoryUpdateRemoteMirrorWorker.perform_in(backoff_delay, self.id, Time.now)
......
...@@ -3,7 +3,7 @@ module EE ...@@ -3,7 +3,7 @@ module EE
extend ActiveSupport::Concern extend ActiveSupport::Concern
def sync? def sync?
super || ::Gitlab::Geo.secondary? super && !::Gitlab::Geo.secondary?
end end
end end
end end
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