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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjQxYjYyMTVkNzk3YmViMmNkMWU4MmE5M2UwNTk1YjA2NzJhZTI3NQ==
4
+ Y2YyZmJlMTFhMDg2ZWYxODIyYjhiOTYzNjAyMGY4MjhmMWQ4ODUzNQ==
5
5
  data.tar.gz: !binary |-
6
- YzQyNTE4MzY3YzlmOTdhY2RjOWQxMjJhMzcxMWNjMmQzODFlYTg0OQ==
6
+ YTZjZWIxNTk2M2RlMDc2NGM1MDM4YWY0NTU0ZDk1MzBlZjEwMmVlYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YjRhMzdiM2Y5YjU0MTVmMDNkM2ZiYTBhYjkwNmNkODcwM2UzODg5YzM0OTdl
10
- YzMwNGMyNDZlNzUxNTk3NDQyNzI2MjViNjA4NDIwYWUyMzFhNDJlM2MwYTAz
11
- YzY4MDQ5YThiZDA1ZGI4Nzc1MTIxMWU3Nzk5Y2QzNDg1MjY1NDA=
9
+ MzU0Mjc3ZjljOGNjMWEwYmYxMzU1NmIxOWI3MmNlMGJhMzFmZTFiYzI1YThh
10
+ M2FlZTdmNjQ4OTAyMDRjMGI4OWMyZTI5Y2FlMGUwYTBmN2Q2OGI5MmVlNWUy
11
+ M2Y0NzQ2NjkyYWRjYzczZDg4OTUwMDY1ODk4NjIyZTI0NTliMDk=
12
12
  data.tar.gz: !binary |-
13
- MDllY2VkY2RlZTQ2MWZkNjM3NjgyNTkzNmRlNGYxNTM4ZjhmZmY1NjBmYzhk
14
- NGQyMThhMjA1ZGU5ZGUwYTlhZjgwMzFiZTA5MzQ1NWI3NzE2MWI4ZmFhYzRh
15
- N2ExN2VlZWNlM2EyNGVkMTNiMzVmMWU2Y2QwN2Q3MGJiNDFjYTU=
13
+ MmQxMGUzMDJmZTE2MTNlNDVkMzM3MTNiZTQzZGJiZTliZDFiOGViZmYyODM4
14
+ MzNhNjgxNzNlODlhZjJjZmNkZmJiODU0ZTZiOWQ0MWE2NTZkOTIxMDg3NWY5
15
+ ZjBhMmJkMmY4NzkxMmNlZDcwMjVkZGYyNGFiN2UyNTlkZjYzMzg=
@@ -1,5 +1,5 @@
1
1
  class Fanforce
2
2
  module Workers
3
- VERSION = '0.3.2'
3
+ VERSION = '0.3.3'
4
4
  end
5
5
  end
@@ -11,9 +11,7 @@ class Fanforce::Worker
11
11
  @worker_data = worker_data
12
12
  @code_block = code_block
13
13
 
14
- msg = iron_mq.queue(worker_data['worker_id']).get(timeout: 3600)
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,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce-workers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Clark