diff options
Diffstat (limited to 'app/models/remote_mirror.rb')
-rw-r--r-- | app/models/remote_mirror.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/models/remote_mirror.rb b/app/models/remote_mirror.rb index 8e7612e63c8..8b15d481c1b 100644 --- a/app/models/remote_mirror.rb +++ b/app/models/remote_mirror.rb @@ -68,13 +68,13 @@ class RemoteMirror < ApplicationRecord after_transition any => :started do |remote_mirror, _| Gitlab::Metrics.add_event(:remote_mirrors_running) - remote_mirror.update(last_update_started_at: Time.now) + remote_mirror.update(last_update_started_at: Time.current) end after_transition started: :finished do |remote_mirror, _| Gitlab::Metrics.add_event(:remote_mirrors_finished) - timestamp = Time.now + timestamp = Time.current remote_mirror.update!( last_update_at: timestamp, last_successful_update_at: timestamp, @@ -86,7 +86,7 @@ class RemoteMirror < ApplicationRecord after_transition started: :failed do |remote_mirror| Gitlab::Metrics.add_event(:remote_mirrors_failed) - remote_mirror.update(last_update_at: Time.now) + remote_mirror.update(last_update_at: Time.current) remote_mirror.run_after_commit do RemoteMirrorNotificationWorker.perform_async(remote_mirror.id) @@ -144,9 +144,9 @@ class RemoteMirror < ApplicationRecord return unless sync? if recently_scheduled? - RepositoryUpdateRemoteMirrorWorker.perform_in(backoff_delay, self.id, Time.now) + RepositoryUpdateRemoteMirrorWorker.perform_in(backoff_delay, self.id, Time.current) else - RepositoryUpdateRemoteMirrorWorker.perform_async(self.id, Time.now) + RepositoryUpdateRemoteMirrorWorker.perform_async(self.id, Time.current) end end @@ -261,7 +261,7 @@ class RemoteMirror < ApplicationRecord def recently_scheduled? return false unless self.last_update_started_at - self.last_update_started_at >= Time.now - backoff_delay + self.last_update_started_at >= Time.current - backoff_delay end def reset_fields |