fanforce-plugin-worker 2.0.0.rc9 → 2.0.0.rc10
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 683f1ab134ad184a10eaf72a77d470b58ff337e1
|
4
|
+
data.tar.gz: 19a9c9bade95b87d38bf468143265b9d3bb13f51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57df5bd8fea25c3445ffcd03e305899619c3c1b01fd8b9b689163d8122ce7b9d92bc9ba54f0cd68a43b3a130823e74dae8e7d4f872fd4baaee8bab84ffcfef5a
|
7
|
+
data.tar.gz: 03eadaf69a7620da81ddc97bcd21d25968335c63d619f2cd7453dd9a869cfcede2bbca7abf19d79c6e2541b2c2454ccdb9025a98d421670f925f5676081de897
|
@@ -6,7 +6,7 @@ class Fanforce::PluginWorker::RunnerLocal
|
|
6
6
|
MAX_EXECUTION_TIME = 3300
|
7
7
|
class Timeout < RuntimeError; end
|
8
8
|
|
9
|
-
def initialize(worker_data, min_execution_time=300
|
9
|
+
def initialize(worker_data, min_execution_time=300)
|
10
10
|
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
|
11
11
|
log.debug '------------------------------------------------------------------------------------'
|
12
12
|
log.debug 'LOADING WORKER ENV'
|
@@ -16,8 +16,6 @@ class Fanforce::PluginWorker::RunnerLocal
|
|
16
16
|
@queue_id = worker_data[:queue_id] || (raise 'worker_data must contain queue_id')
|
17
17
|
@current_params = MultiJson.load(worker_data[:params].to_json, symbolize_keys: true)
|
18
18
|
@current_retries = 0
|
19
|
-
|
20
|
-
run_job(&code_block)
|
21
19
|
end
|
22
20
|
|
23
21
|
def run_job(&code_block)
|
@@ -25,9 +23,10 @@ class Fanforce::PluginWorker::RunnerLocal
|
|
25
23
|
log.debug 'PROCESSING JOB...'
|
26
24
|
log.debug '------------------------------------------------------------------------------------'
|
27
25
|
|
28
|
-
code_block.call(@current_params.clone, retries: @current_retries, queue_id: @queue_id)
|
26
|
+
response = code_block.call(@current_params.clone, retries: @current_retries, queue_id: @queue_id)
|
29
27
|
|
30
28
|
log.debug 'WINDING DOWN WORKER!'
|
29
|
+
response
|
31
30
|
end
|
32
31
|
|
33
32
|
end
|
@@ -59,7 +59,7 @@ class Fanforce::PluginWorker
|
|
59
59
|
|
60
60
|
def self.run(worker_data, min_execution_time=300, &code_block)
|
61
61
|
if [true,'true'].include?(ENV['FANFORCE_WORKER_SHOULD_BYPASS_ENQUEUE'])
|
62
|
-
RunnerLocal.new(worker_data, min_execution_time
|
62
|
+
RunnerLocal.new(worker_data, min_execution_time).run_job(&code_block)
|
63
63
|
else
|
64
64
|
Runner.new(worker_data, min_execution_time, &code_block)
|
65
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fanforce-plugin-worker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.rc10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Caleb Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: iron_mq
|