lib/resque/status.rb in resque-status-0.2.2 vs lib/resque/status.rb in resque-status-0.2.3
- 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.2.2'
+ VERSION = '0.2.3'
extend Resque::Helpers
# Create a status, generating a new UUID, passing the message to the status
# Returns the UUID of the new status.
@@ -80,15 +80,10 @@
redis.zrevrange(set_key, 0, -1) || []
else
# Because we want a reverse chronological order, we need to get a range starting
# by the higest negative number. The ordering is transparent from the API user's
# perspective so we need to convert the passed params
- if range_start == 0
- range_start = -1
- else
- range_end -= 1
- end
- (redis.zrevrange(set_key, -(range_end.abs), -(range_start.abs)) || []).reverse
+ (redis.zrevrange(set_key, (range_start.abs), ((range_end || 1).abs)) || [])
end
end
# Kill the job at UUID on its next iteration this works by adding the UUID to a
# kill list (a.k.a. a list of jobs to be killed. Each iteration the job checks