Class: Resque::StuckQueue::HeartbeatJob

Inherits:
Object
  • Object
show all
Defined in:
lib/resque_stuck_queue/heartbeat_job.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.redisObject

Returns the value of attribute redis.



6
7
8
# File 'lib/resque_stuck_queue/heartbeat_job.rb', line 6

def redis
  @redis
end

Class Method Details

.perform(*args) ⇒ Object



8
9
10
11
12
13
# File 'lib/resque_stuck_queue/heartbeat_job.rb', line 8

def perform(*args)
  keyname,host,port,namespace = *args
  @redis = Redis::Namespace.new(namespace, :redis => Redis.new(:host => host, :port => port))
  @redis.set(keyname, Time.now.to_i)
  Resque::StuckQueue.logger.info "successfully updated key #{keyname}"
end