lib/fanforce/worker/errors.rb in fanforce-worker-0.17.1 vs lib/fanforce/worker/errors.rb in fanforce-worker-0.17.2
- old
+ new
@@ -12,16 +12,18 @@
def self.find(queue_id, error_id)
Fanforce::Worker::Error.new(queue_id, error_id)
end
- def self.list(queue_id, from_num=0, to_num=100)
+ def self.list(queue_id, from_num=0, to_num=100, reverse=false)
error_ids = redis.lrange("ERRORS:#{queue_id}", from_num, to_num)
+ error_ids.reverse! if reverse
Fanforce::Worker::ErrorList.new(queue_id, error_ids)
end
- def self.list_summaries(queue_id, from_num=0, to_num=100)
+ def self.list_summaries(queue_id, from_num=0, to_num=100, reverse=false)
error_ids = redis.lrange("ERRORS:#{queue_id}", from_num, to_num)
+ error_ids.reverse! if reverse
Fanforce::Worker::ErrorList.new(queue_id, error_ids).summaries
end
def self.delete_all(queue_id, error_ids)
Fanforce::Worker::ErrorList.new(queue_id, error_ids).delete