lib/resque/status.rb in resque-status-0.1.0 vs lib/resque/status.rb in resque-status-0.1.1
- old
+ new
@@ -5,11 +5,11 @@
module Resque
# Resque::Status is a Hash object that has helper methods for dealing with
# the common status attributes. It also has a number of class methods for
# creating/updating/retrieving status objects from Redis
class Status < Hash
- VERSION = '0.1.0'
+ VERSION = '0.1.1'
extend Resque::Helpers
# Create a status, generating a new UUID, passing the message to the status
# Returns the UUID of the new status.
@@ -34,9 +34,16 @@
redis.set(status_key(uuid), encode(val))
if expire_in
redis.expire(status_key(uuid), expire_in)
end
val
+ end
+
+ def self.clear
+ status_ids.each do |id|
+ redis.del(status_key(id))
+ redis.zrem(set_key, id)
+ end
end
# returns a Redisk::Logger scoped to the UUID. Any options passed are passed
# to the logger initialization.
def self.logger(uuid, options = {})
\ No newline at end of file