Permalink
Browse files

modules: fix default config values

`buffer` and `http_client` modules used `rescue` instead of `or` or `||`
for using default config values when no value was present.

fixes #90
  • Loading branch information...
kabaka committed Mar 19, 2016
1 parent 5ed39f2 commit 6da7ea9a2bbdc3b1bd9bfd891dd33a99afc47fe2
Showing with 2 additions and 2 deletions.
  1. +1 −1 modules/buffer.rb
  2. +1 −1 modules/http_client.rb
View
@@ -66,7 +66,7 @@ def record_message msg
:text => text,
:nick => msg.nick}
max = Conf[:modules][:buffer][:max_size] rescue 100
max = Conf[:modules][:buffer][:max_size] or 100
# TODO: This is nasty. I am using a loop here because we might be
# rehashed with a smaller value and have to shift it down to size. There
View
@@ -136,7 +136,7 @@ def self.http_request uri, query, get, msg, silent_err, opts, &block
args.merge! opts
max_time = conf[:max_time].to_i rescue 5
max_time = conf[:max_time].to_i or 5
unless max_time.zero?
EM.add_timer(max_time) do

0 comments on commit 6da7ea9

Please sign in to comment.