Commit d3e2d9d5 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Do not execute some periodical auxiliary jobs on secondary geo node

parent 77986484
...@@ -2,6 +2,7 @@ class HistoricalDataWorker ...@@ -2,6 +2,7 @@ class HistoricalDataWorker
include Sidekiq::Worker include Sidekiq::Worker
def perform def perform
return if Gitlab::Geo.secondary?
HistoricalData.track! HistoricalData.track!
end end
end end
...@@ -4,6 +4,7 @@ class StuckCiBuildsWorker ...@@ -4,6 +4,7 @@ class StuckCiBuildsWorker
BUILD_STUCK_TIMEOUT = 1.day BUILD_STUCK_TIMEOUT = 1.day
def perform def perform
return if Gitlab::Geo.secondary?
Rails.logger.info 'Cleaning stuck builds' Rails.logger.info 'Cleaning stuck builds'
builds = Ci::Build.running_or_pending.where('updated_at < ?', BUILD_STUCK_TIMEOUT.ago) builds = Ci::Build.running_or_pending.where('updated_at < ?', BUILD_STUCK_TIMEOUT.ago)
......
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