mattyr / sidecloq

Recurring / Periodic / Scheduled / Cron job extension for Sidekiq
MIT License
88 stars 12 forks source link

Fail to read sidecroq.yml if env has no crons #47

Closed bendangelo closed 1 year ago

bendangelo commented 1 year ago

If your sidecroq.yml file looks like this (empty):

development:
  # job:

You'll get this error.

3:16:42 worker.1 | undefined method `each_with_object' for nil:NilClass
13:16:42 worker.1 | /Users/ben/.rvm/gems/ruby-3.2.2/bundler/gems/sidecloq-c802bac8cbb9/lib/sidecloq/schedule.rb:37:in `from_hash'
13:16:42 worker.1 | /Users/ben/.rvm/gems/ruby-3.2.2/bundler/gems/sidecloq-c802bac8cbb9/lib/sidecloq/schedule.rb:15:in `from_yaml'
13:16:42 worker.1 | /Users/ben/.rvm/gems/ruby-3.2.2/bundler/gems/sidecloq-c802bac8cbb9/lib/sidecloq.rb:68:in `extract_schedule'
13:16:42 worker.1 | /Users/ben/.rvm/gems/ruby-3.2.2/bundler/gems/sidecloq-c802bac8cbb9/lib/sidecloq.rb:43:in `startup'
13:16:42 worker.1 | /Users/ben/.rvm/gems/ruby-3.2.2/bundler/gems/sidecloq-c802bac8cbb9/lib/sidecloq.rb:21:in `block (2 levels) in install'