lib/fanforce/worker/errors.rb in fanforce-worker-0.21.0 vs lib/fanforce/worker/errors.rb in fanforce-worker-0.21.1
- old
+ new
@@ -5,11 +5,11 @@
include Fanforce::Worker::Utils
@@redis = nil
def self.redis
- @@redis ||= Redis.new(url: Fanforce::Worker.redis_url)
+ @@redis ||= Redis.new(url: Fanforce::Worker.redis_url_errorlog)
end
def self.find(queue_id, error_id)
Fanforce::Worker::Error.new(queue_id, error_id)
end
@@ -139,13 +139,13 @@
redis.hgetall("ERRORS:#{queue_id}:#{error_id}")
end
def self.retry(queue_id, raw_error)
error = format(raw_error.symbolize_keys)
- params = MultiJson.load(error[:raw_json], symbolize_keys: true) rescue {}
+ payload = MultiJson.load(error[:raw_json], symbolize_keys: true) rescue {}
Fanforce::Worker.set_config(iron_token: error[:iron_token], iron_project_id: error[:iron_project_id])
- Fanforce::Worker.enqueue(queue_id, params, :retries => error[:retries] + 1)
+ Fanforce::Worker.enqueue(queue_id, payload, :retries => error[:retries] + 1)
delete(queue_id, error[:error_id])
end
end
@@ -193,6 +193,7 @@
Error.delete(@queue_id, error_id)
end
end
return nil
end
+
end