Commit 87ef992d authored by Tiago Botelho's avatar Tiago Botelho

add changelog entry

parent bc510c29
---
title: Add configurable minimum mirror sync time in admin section
merge_request: 1217
author:
require 'gitlab/current_settings'
include Gitlab::CurrentSettings
# Custom Redis configuration
redis_config_hash = Gitlab::Redis.params
redis_config_hash[:namespace] = Gitlab::Redis::SIDEKIQ_NAMESPACE
......
module Gitlab
module Mirror
include Gitlab::CurrentSettings
FIFTEEN = 15
HOURLY = 60
DAILY = 1440
......@@ -31,6 +33,7 @@ module Gitlab
def configure_cron_jobs!
minimum_mirror_sync_time = current_application_settings.minimum_mirror_sync_time rescue DAILY
sync_time = SYNC_TIME_TO_CRON[minimum_mirror_sync_time]
update_all_mirrors_worker_job = Sidekiq::Cron::Job.find("update_all_mirrors_worker")
update_all_remote_mirrors_worker_job = Sidekiq::Cron::Job.find("update_all_remote_mirrors_worker")
......@@ -41,12 +44,12 @@ module Gitlab
Sidekiq::Cron::Job.create(
name: 'update_all_remote_mirrors_worker',
cron: SYNC_TIME_TO_CRON[minimum_mirror_sync_time],
cron: sync_time,
class: 'UpdateAllRemoteMirrorsWorker'
)
Sidekiq::Cron::Job.create(
name: 'update_all_mirrors_worker',
cron: SYNC_TIME_TO_CRON[minimum_mirror_sync_time],
cron: sync_time,
class: 'UpdateAllMirrorsWorker'
)
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