Skip to content

Commit

Permalink
Check Config File Existence (sidekiq#4054)
Browse files Browse the repository at this point in the history
* Check config file existence

* Eager config file check

* Parse expanded path to default sidekiq.yml config file in Rails app

* Cleanup
  • Loading branch information
Tensho committed Dec 28, 2018
1 parent 7021652 commit 8cad1fa
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/sidekiq/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,8 @@ def initialize_logger
Sidekiq.logger.level = ::Logger::DEBUG if options[:verbose]
end

def parse_config(cfile)
opts = {}
if File.exist?(cfile)
opts = YAML.load(ERB.new(IO.read(cfile)).result) || opts
end
def parse_config(path)
opts = YAML.load(ERB.new(File.read(path)).result) || {}

if opts.respond_to? :deep_symbolize_keys!
opts.deep_symbolize_keys!
Expand Down

0 comments on commit 8cad1fa

Please sign in to comment.