Skip to content

Commit

Permalink
Refactored settings init with default values
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr Borisov committed Feb 4, 2019
1 parent 94eee1b commit 31c6ab0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/sidekiq/worker_killer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class WorkerKiller
MUTEX = Mutex.new

def initialize(options = {})
@max_rss = (options[:max_rss] || 0)
@max_rss = options.fetch(:max_rss, 0)
@grace_time = options.fetch(:grace_time, 15 * 60)
@shutdown_wait = (options[:shutdown_wait] || 30)
@kill_signal = (options[:kill_signal] || "SIGKILL")
@shutdown_wait = options.fetch(:shutdown_wait, 30)
@kill_signal = options.fetch(:kill_signal, "SIGKILL")
@gc = options.fetch(:gc, true)
end

Expand Down

0 comments on commit 31c6ab0

Please sign in to comment.