fanforce-worker 0.31.0 → 0.32.0
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 +1 -0
- data/lib/fanforce/worker/runner.rb +2 -2
- data/lib/fanforce/worker/utils.rb +4 -0
- data/lib/fanforce/worker/version.rb +1 -1
- data/lib/fanforce/worker/worker.rb +1 -0
- 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: 7c71c11441ca20666707cfda018361ddcae5108e
|
4
|
+
data.tar.gz: 9e9fd0de91fb612f9eb9dabf9227ebe0d9c033d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6bb2bd78b13048972dc62afe18e7dfdc873080069a464f158bdfdb959cb807724510d6bd481007448812bfc497a6bbc90139f704963467394f64fe2dd3582e6
|
7
|
+
data.tar.gz: 7951521e3f433a99bebbc38d2bec824fa1f9324ae8de869cae8ea73f5c390ba1ea5807c6bd3ef5ee768547af547dbf2c68ac9632a60887df9bda14a8fcfc5d10
|
@@ -142,6 +142,7 @@ class Fanforce::Worker::Error
|
|
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
|
+
queue_id = queue_id.gsub(":#{ENV['DEVELOPER_EMAIL']}", '') if ENV['DEVELOPER_EMAIL']
|
145
146
|
Fanforce::Worker.set_config(iron_token: error[:iron_token], iron_project_id: error[:iron_project_id])
|
146
147
|
Fanforce::Worker.enqueue(queue_id, payload, :retries => error[:retries] + 1)
|
147
148
|
delete(queue_id, error[:error_id])
|
@@ -12,7 +12,7 @@ class Fanforce::Worker::Runner
|
|
12
12
|
raise "min_execution_time was set to #{min_execution_time}, which is #{min_execution_time - MAX_EXECUTION_TIME} seconds too long" if min_execution_time > MAX_EXECUTION_TIME
|
13
13
|
log.debug 'LOADING WORKER ENV'
|
14
14
|
|
15
|
-
@queue_id
|
15
|
+
@queue_id = worker_data['queue_id'] || (raise 'worker_data must contain queue_id')
|
16
16
|
@worker_env = worker_data['env_vars'] || {}
|
17
17
|
|
18
18
|
@min_execution_time = min_execution_time
|
@@ -27,7 +27,7 @@ class Fanforce::Worker::Runner
|
|
27
27
|
log.debug '------------------------------------------------------------------------------------'
|
28
28
|
job_num = 0
|
29
29
|
job_data = nil
|
30
|
-
while job_has_enough_time_to_run and (job = Fanforce::Worker.iron_mq.queue(@queue_id).get(timeout: 3600)) do
|
30
|
+
while job_has_enough_time_to_run and (job = Fanforce::Worker.iron_mq.queue(iron_queue_id(@queue_id)).get(timeout: 3600)) do
|
31
31
|
log.debug "- JOB #{job_num+=1}: #{job.body}"
|
32
32
|
timeout(worker_time_remaining, Timeout) do
|
33
33
|
job_data = nil
|
@@ -38,6 +38,7 @@ class Fanforce::Worker
|
|
38
38
|
def self.enqueue(queue_id, params, options={})
|
39
39
|
raise 'Params being sent to the queue must be a Hash' if !params.is_a?(Hash)
|
40
40
|
|
41
|
+
queue_id = Utils.iron_queue_id(queue_id)
|
41
42
|
retries = (options[:retries].present?) ? options.delete(:retries) : 0
|
42
43
|
iron_mq.queue(queue_id).post({params: params, retries: retries}.to_json, options)
|
43
44
|
end
|
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.
|
4
|
+
version: 0.32.0
|
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-09-
|
11
|
+
date: 2014-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: iron_mq
|