Class: Notifu::Cleaner

Inherits:
Object show all
Includes:
Util, Sidekiq::Worker
Defined in:
lib/notifu/workers/processor.rb

Instance Method Summary collapse

Methods included from Util

option

Instance Method Details

#log(prio, msg) ⇒ Object



439
440
441
# File 'lib/notifu/workers/processor.rb', line 439

def log(prio, msg)
  $logger.log prio, "JID-#{self.jid}: " + msg.to_s
end

#perform(notifu_id, delay = 15) ⇒ Object



429
430
431
432
433
434
435
436
437
# File 'lib/notifu/workers/processor.rb', line 429

def perform notifu_id, delay=15
  sleep delay
  begin
    Notifu::Model::Issue.with(:notifu_id, notifu_id).delete
    log "info", "Cleanup NID #{notifu_id} - success"
  rescue NoMethodError
    log "info", "Cleanup NID #{notifu_id} - not found"
  end
end