fanforce-worker 0.14.4 → 0.15.0

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
- MWNkZDg3ZTQ1N2Y2NWY0M2ZkNWQ1NDEzN2ViNjI4YjM2Y2JhMDVlNA==
4
+ NzVlYWZhZWUyOTlkNWZkMmIwNzkzMDAyMDJlMGU2MDkzZjhhNzBhNw==
5
5
  data.tar.gz: !binary |-
6
- OWYwOWJhMmQ2ZTk5NzlmYTdiZjNmOTRhZmEzNzkwMjI4ODg4Y2I5ZA==
6
+ MzAwYWFkMDMzMjZjMWZmOGMzYmM2NjM5Y2Y0ZmFkN2VhMzYzNjc4Zg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NTNlY2IzZTllYTRkZmFkMjY0NmI0YTRiNTk3NjhmNDVmODI3MjZmMmM1ODZh
10
- MThjMjAxNzE3ZTU0MWE5ODI4OTY5ZjQ2ZjY0OWI3YmQ5YWRjYzA4YTlmYjVl
11
- Njg5NTI5ODdmMzFjOGI1MWQ3MjFmMDY3NjNhZTY1NGQ2MmUzYjg=
9
+ YjgwNjRjMDYxYTJlYzNiYmY0ZDBhMzY0MmQ3ODM3MWY0NjlmMTFjM2E0N2Vh
10
+ ZjFhZTZhZmVmYTFjNTQ0N2VkMjZhYTcyOWMxMDRjYTYzYzRmNTg3ZWY4YjA0
11
+ ZGJlMmY4NGRmOTBkOTBjYTQzMGMyNWEzMDRiMjU1MGViMjM3ODQ=
12
12
  data.tar.gz: !binary |-
13
- MDRhNTBhN2EzYmYzZDkxYzcwZWNlMmQ2YzFkNTZmNGRhYzc0MmNlZTQ0Yzk1
14
- NjhmNzM4ZmViMThkYmQ5Y2MxMzUwZGFjZDlkMDI2MTNiZDgyNThlODM3OTBj
15
- NzVlNGMxY2FlOWVhZjgzYmIxNzQ2M2NmY2IyOWM2NGIxMTkxMWU=
13
+ OWI1NWVmNzBmYjgxZGYxMDRlMDZjZWRiODM0ZDFiMzhkNjJhYTg2YjA0NzA2
14
+ NGI4MDA2NDY0MWMzMDFmOWRmYTRjMjZlOTk5OGNlZWZkNTdmMDI1OTM5Mzg4
15
+ ZjA0YmVhOGE5YjUyNmNlNDA0NTAyYTM0NzhjMTczZDBhODlkNDE=
@@ -1,5 +1,5 @@
1
1
  class Fanforce
2
2
  class Worker
3
- VERSION = '0.14.4'
3
+ VERSION = '0.15.0'
4
4
  end
5
5
  end
@@ -147,7 +147,7 @@ class Fanforce::Worker
147
147
  def self.run(worker_data, min_execution_time=300, &code_block)
148
148
  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
149
149
 
150
- puts 'LOADING ENV...'
150
+ puts 'LOADING WORKER ENV...'
151
151
  load_env
152
152
  require 'iron_mq'
153
153
  require 'iron_cache'
@@ -158,7 +158,8 @@ class Fanforce::Worker
158
158
  self.current_worker_env = worker_data['env_vars']
159
159
  queue = IronMQ::Client.new.queue(current_queue_id)
160
160
 
161
- puts 'PROCESSING...'
161
+ puts 'PROCESSING JOBS...'
162
+ puts '------------------------------------------------------------------------------------'
162
163
  job_num = 0
163
164
  job_data = nil
164
165
  while job_has_enough_time_to_run(min_execution_time) and (job = queue.get(timeout: 3600)) do
@@ -169,9 +170,10 @@ class Fanforce::Worker
169
170
  run_job(job, job_data, &code_block)
170
171
  end
171
172
  self.delete_job
173
+ puts '------------------------------------------------------------------------------------'
172
174
  end
173
175
  self.delete_job
174
- puts " FINISHED JOB #{job_num+=1}"
176
+ puts 'WINDING DOWN WORKER!'
175
177
  rescue Timeout::Error => e
176
178
  handle_job_error(e, job, job_data)
177
179
  rescue Exception => e
@@ -195,9 +197,6 @@ class Fanforce::Worker
195
197
  end
196
198
 
197
199
  def self.run_job(job, job_data, &code_block)
198
- puts '----------------------------------------------------------'
199
- puts 'PROCESSING JOB... '
200
-
201
200
  self.current_job = job
202
201
  self.current_params = job_data[:params]
203
202
  self.current_retries = job_data[:retries]
@@ -214,9 +213,7 @@ class Fanforce::Worker
214
213
  raise($!, "#{$!}: THERE IS NO JOB", $!.backtrace) if job.nil?
215
214
 
216
215
  self.delete_job(job)
217
- puts 'REMOVED JOB FROM QUEUE'
218
-
219
- puts 'CANNOT SAVE TO ERROR CACHE:'
216
+ puts 'REMOVED JOB FROM QUEUE, BUT COULD NOT SAVE TO ERROR CACHE...'
220
217
  raise($!, "#{$!}: #{job_data.to_json}", $!.backtrace)
221
218
  end
222
219
 
@@ -234,9 +231,8 @@ class Fanforce::Worker
234
231
  error[:curl_command] = e.curl_command if e.respond_to?(:curl_command)
235
232
 
236
233
  self.delete_job(job)
237
- puts 'REMOVED JOB FROM QUEUE'
238
-
239
- puts "SAVING TO ERROR CACHE: #{error.to_json}"
234
+ puts 'REMOVED JOB FROM QUEUE, AND SAVING TO ERROR CACHE...'
235
+ puts error.to_json
240
236
  self.add_error current_queue_id, error
241
237
  end
242
238
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce-worker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.4
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Clark