diff options
Diffstat (limited to 'app/models/remote_mirror.rb')
-rw-r--r-- | app/models/remote_mirror.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/remote_mirror.rb b/app/models/remote_mirror.rb index 7f41f0907d5..f8d500e106b 100644 --- a/app/models/remote_mirror.rb +++ b/app/models/remote_mirror.rb @@ -128,7 +128,7 @@ class RemoteMirror < ApplicationRecord def sync return unless sync? - if recently_scheduled? + if schedule_with_delay? RepositoryUpdateRemoteMirrorWorker.perform_in(backoff_delay, self.id, Time.current) else RepositoryUpdateRemoteMirrorWorker.perform_async(self.id, Time.current) @@ -261,7 +261,8 @@ class RemoteMirror < ApplicationRecord super end - def recently_scheduled? + def schedule_with_delay? + return false if Feature.enabled?(:remote_mirror_no_delay, project, type: :ops) return false unless self.last_update_started_at self.last_update_started_at >= Time.current - backoff_delay |