fanforce-worker 0.21.0 → 0.21.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fanforce/worker/errors.rb +4 -3
- data/lib/fanforce/worker/version.rb +1 -1
- data/lib/fanforce/worker/worker.rb +3 -3
- data/test/test_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf99c7e55486c780a68cca231e3dd8fe881ee05e
|
4
|
+
data.tar.gz: f7244e5bfdf9ae11fa932f03e021dbb16c6bb20d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c695c59c1e02420925292f92669c738d68f4207e56dfe632946610397977ae15cfea8a24b89e4f614ee17ecdd54b1708cb33ba2678ea2d0638fd35a044fdc33
|
7
|
+
data.tar.gz: c56228a5cd8f1069fb9d2616863f2b0989f73f163f6b8130d7e100fd8bcabf70f1dd5d0911f7d27bc65144bf58b67bae9abeb837701e8b971f4ae1418ea2bb11
|
@@ -7,7 +7,7 @@ class Fanforce::Worker::Errors
|
|
7
7
|
@@redis = nil
|
8
8
|
|
9
9
|
def self.redis
|
10
|
-
@@redis ||= Redis.new(url: Fanforce::Worker.
|
10
|
+
@@redis ||= Redis.new(url: Fanforce::Worker.redis_url_errorlog)
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.find(queue_id, error_id)
|
@@ -141,9 +141,9 @@ class Fanforce::Worker::Error
|
|
141
141
|
|
142
142
|
def self.retry(queue_id, raw_error)
|
143
143
|
error = format(raw_error.symbolize_keys)
|
144
|
-
|
144
|
+
payload = MultiJson.load(error[:raw_json], symbolize_keys: true) rescue {}
|
145
145
|
Fanforce::Worker.set_config(iron_token: error[:iron_token], iron_project_id: error[:iron_project_id])
|
146
|
-
Fanforce::Worker.enqueue(queue_id,
|
146
|
+
Fanforce::Worker.enqueue(queue_id, payload, :retries => error[:retries] + 1)
|
147
147
|
delete(queue_id, error[:error_id])
|
148
148
|
end
|
149
149
|
|
@@ -195,4 +195,5 @@ class Fanforce::Worker::ErrorList
|
|
195
195
|
end
|
196
196
|
return nil
|
197
197
|
end
|
198
|
+
|
198
199
|
end
|
@@ -19,14 +19,14 @@ class Fanforce::Worker
|
|
19
19
|
@@iron[:mq] ||= IronMQ::Client.new(:token => @@iron[:token], :project_id => @@iron[:project_id])
|
20
20
|
end
|
21
21
|
|
22
|
-
def self.
|
23
|
-
@@redis[:
|
22
|
+
def self.redis_url_errorlog
|
23
|
+
@@redis[:url_errorlog] || ENV['REDIS_URL_ERRORLOG'] || (raise 'No REDIS_URL_ERRORLOG found in ENV')
|
24
24
|
end
|
25
25
|
|
26
26
|
def self.set_config(obj)
|
27
27
|
@@iron[:token] = obj[:iron_token] if obj[:iron_token]
|
28
28
|
@@iron[:project_id] = obj[:iron_project_id] if obj[:iron_project_id]
|
29
|
-
@@redis[:
|
29
|
+
@@redis[:url_errorlog] = obj[:redis_url_errorlog] if obj[:redis_url_errorlog]
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.log
|
data/test/test_helper.rb
CHANGED
@@ -13,7 +13,7 @@ def clean_dbs
|
|
13
13
|
Fanforce::Worker.set_config(
|
14
14
|
iron_token: 'TF0YNz8na2H_reJ7_EoRnQAeKHM',
|
15
15
|
iron_project_id: '53725dfe0db3ef0005000001',
|
16
|
-
|
16
|
+
redis_url_errorlog: 'redis://localhost:6379/5'
|
17
17
|
)
|
18
18
|
Fanforce::Worker.iron_mq.queues.all.each do |queue|
|
19
19
|
queue.delete_queue
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fanforce-worker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.21.
|
4
|
+
version: 0.21.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Caleb Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: iron_mq
|