Skip to content

Commit

Permalink
fix: использоание параметров по умолчанию
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryBochkarev committed Sep 4, 2017
1 parent 6ae1c1f commit 949023c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/resque/integration/queues_info/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions spec/resque/integration/queues_info_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
]
Expand Down

0 comments on commit 949023c

Please sign in to comment.