fanforce-workers 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/fanforce/workers/version.rb +1 -1
- data/lib/fanforce/workers/worker.rb +7 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2YyZmJlMTFhMDg2ZWYxODIyYjhiOTYzNjAyMGY4MjhmMWQ4ODUzNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTZjZWIxNTk2M2RlMDc2NGM1MDM4YWY0NTU0ZDk1MzBlZjEwMmVlYw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzU0Mjc3ZjljOGNjMWEwYmYxMzU1NmIxOWI3MmNlMGJhMzFmZTFiYzI1YThh
|
10
|
+
M2FlZTdmNjQ4OTAyMDRjMGI4OWMyZTI5Y2FlMGUwYTBmN2Q2OGI5MmVlNWUy
|
11
|
+
M2Y0NzQ2NjkyYWRjYzczZDg4OTUwMDY1ODk4NjIyZTI0NTliMDk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmQxMGUzMDJmZTE2MTNlNDVkMzM3MTNiZTQzZGJiZTliZDFiOGViZmYyODM4
|
14
|
+
MzNhNjgxNzNlODlhZjJjZmNkZmJiODU0ZTZiOWQ0MWE2NTZkOTIxMDg3NWY5
|
15
|
+
ZjBhMmJkMmY4NzkxMmNlZDcwMjVkZGYyNGFiN2UyNTlkZjYzMzg=
|
@@ -11,9 +11,7 @@ class Fanforce::Worker
|
|
11
11
|
@worker_data = worker_data
|
12
12
|
@code_block = code_block
|
13
13
|
|
14
|
-
|
15
|
-
puts msg.body
|
16
|
-
(msg.nil?) ? (return) : run_worker(msg)
|
14
|
+
run_worker iron_mq.queue(worker_data['worker_id']).get(timeout: 3600)
|
17
15
|
end
|
18
16
|
|
19
17
|
def require_dependencies
|
@@ -31,8 +29,8 @@ class Fanforce::Worker
|
|
31
29
|
end
|
32
30
|
|
33
31
|
def run_worker(msg)
|
32
|
+
puts '----------------------------------------------------------'
|
34
33
|
print 'PROCESSING MESSAGE: '
|
35
|
-
puts msg.body
|
36
34
|
task_data = Fanforce.decode_json(msg.body)
|
37
35
|
|
38
36
|
set_env_vars(@worker_data['env_vars'])
|
@@ -40,6 +38,11 @@ class Fanforce::Worker
|
|
40
38
|
msg.delete
|
41
39
|
|
42
40
|
rescue Exception => e
|
41
|
+
if msg.nil?
|
42
|
+
puts 'MESSAGE IS NIL'
|
43
|
+
return
|
44
|
+
end
|
45
|
+
|
43
46
|
task_data[:last_error] = {
|
44
47
|
exception: e.class.name,
|
45
48
|
message: e.message,
|