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