Module: ExceptionNotifier

Defined in:
lib/exception_notification_moderate/exception_notifier.rb

Class Method Summary collapse

Class Method Details

.notify_exception(exception, options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/exception_notification_moderate/exception_notifier.rb', line 8

def notify_exception(exception, options={})
  ex_key = exception_key(exception)

  val = execute_with_rescue_error { redis.get(ex_key) }
  if val && val.to_i + 60 > Time.now.to_i
    # Write log and return.
    ExceptionNotificationModerate.logger.info(exception)
    return false
  end

  execute_with_rescue_error { redis.set(ex_key, Time.now.to_i) }
  original_notify_exception(exception, options)
end

.original_notify_exceptionObject



6
# File 'lib/exception_notification_moderate/exception_notifier.rb', line 6

alias_method :original_notify_exception, :notify_exception