FIX updage sidekiq cron

This commit is contained in:
Jasder 2021-01-14 18:22:01 +08:00
parent f959b38a89
commit 1e9bd451e5
3 changed files with 7 additions and 6 deletions

View File

@ -1,10 +1,10 @@
redis_config = Rails.application.config_for(:redis)
sidekiq_url = redis_config["url"]
sidekiq_url = redis_config["url"] || 'redis://localhost:6379/0'
Sidekiq.configure_server do |config|
config.redis = { url: sidekiq_url }
schedule_file = "config/schedule.yml"
schedule_file = "config/sidekiq_cron.yml"
if File.exists?(schedule_file)
Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file)
end

View File

@ -1,4 +0,0 @@
sync_gitea_repo_updated_at:
cron: "0 0 * * * "
class: "SyncRepoUpdateTimeJob"
queue: default

5
config/sidekiq_cron.yml Normal file
View File

@ -0,0 +1,5 @@
sync_gitea_repo_update_time:
cron: "0 0 * * * "
class: "SyncRepoUpdateTimeJob"
queue: default
description: 'sync gitea repo update time