From 949023c3bf2a0600a8f63ba8e9f5817dcbc25382 Mon Sep 17 00:00:00 2001 From: Dmitry Bochkarev Date: Mon, 4 Sep 2017 10:57:17 +0500 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D0=BE=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=B0=D1=80=D0=B0?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D1=80=D0=BE=D0=B2=20=D0=BF=D0=BE=20=D1=83?= =?UTF-8?q?=D0=BC=D0=BE=D0=BB=D1=87=D0=B0=D0=BD=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/resque/integration/queues_info/config.rb | 2 +- spec/resque/integration/queues_info_spec.rb | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/resque/integration/queues_info/config.rb b/lib/resque/integration/queues_info/config.rb index ee949ac..f428821 100644 --- a/lib/resque/integration/queues_info/config.rb +++ b/lib/resque/integration/queues_info/config.rb @@ -43,7 +43,7 @@ def data private def threshold(queue, param) - (@queues[queue] || @defaults)[param] + @queues[queue].try(:[], param) || @defaults[param] end def load_config(path) diff --git a/spec/resque/integration/queues_info_spec.rb b/spec/resque/integration/queues_info_spec.rb index 4a9ad27..acbad7c 100644 --- a/spec/resque/integration/queues_info_spec.rb +++ b/spec/resque/integration/queues_info_spec.rb @@ -354,18 +354,18 @@ }, { '{#QUEUE}' => 'second_queue', - '{#THRESHOLD_AGE}' => nil, - '{#THRESHOLD_SIZE}' => nil, - '{#THRESHOLD_FAILURES_PER_5M}' => nil, - '{#THRESHOLD_FAILURES_PER_1H}' => nil, + '{#THRESHOLD_AGE}' => 10, + '{#THRESHOLD_SIZE}' => 10, + '{#THRESHOLD_FAILURES_PER_5M}' => 5, + '{#THRESHOLD_FAILURES_PER_1H}' => 60, '{#CHANNEL}' => 'first second' }, { '{#QUEUE}' => 'without_channel', - '{#THRESHOLD_AGE}' => nil, - '{#THRESHOLD_SIZE}' => nil, - '{#THRESHOLD_FAILURES_PER_5M}' => nil, - '{#THRESHOLD_FAILURES_PER_1H}' => nil, + '{#THRESHOLD_AGE}' => 10, + '{#THRESHOLD_SIZE}' => 10, + '{#THRESHOLD_FAILURES_PER_5M}' => 5, + '{#THRESHOLD_FAILURES_PER_1H}' => 60, '{#CHANNEL}' => 'default' } ]