skyrunner 0.1.0 → 0.1.1

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: b6d11252dc57758004a10bba1e6d9321f07a6629
4
- data.tar.gz: fe23c5593a322c8a39a90db60b8d0f6632768a19
3
+ metadata.gz: 4a2ced9a38b36395ef00e5eacfb9d6ff57711f06
4
+ data.tar.gz: 95ec876e3a8e95eca0498b451ae677ef390a1e11
5
5
  SHA512:
6
- metadata.gz: 6b2dc81fcdd2416d16973511e929731556661c6b8e4b4b9c0ef578ed3c500b61ce744e42925caa08709b503915b5c37224cb82841e1bb94468ec5e52ee7f960e
7
- data.tar.gz: b61a040c8e9c8d3a829a3e1a56b546d1fcc61fa699d2c27dc5b1d2f1eaa6c9415f834ff8b88b627731e956ae2926c6dc6cc57e0f4ee6ef767d0ebb3b5757ad67
6
+ metadata.gz: d5ad890cdaa3a625f0056587a18f56601c2ac5d9a9039a5151805ee109ad2f4c19b79dadc9637790bb1eaee70f681ad20c3cc8ce9f6208bcb0c8053479b571f0
7
+ data.tar.gz: d05d068716f2c988700810eed2083bc18f940135ec5fcada0e5c275723b13f53dff9970e7eba791c096160635df529be8249c1b14d8f3c7b621a17c902d0a16b
@@ -1,3 +1,3 @@
1
1
  module Skyrunner
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/skyrunner.rb CHANGED
@@ -73,25 +73,26 @@ module SkyRunner
73
73
 
74
74
  1.upto(SkyRunner::num_threads) do
75
75
  threads << Thread.new do
76
- sqs = AWS::SQS.new
77
-
78
76
  loop do
79
- break if SkyRunner::stop_consuming?
77
+ break if SkyRunner::stop_consuming? && local_queue.size == 0
78
+
80
79
  sleep 1 unless local_queue.size > 0
81
80
 
82
81
  klass, job_id, task_args, message = local_queue.pop
83
82
 
84
- SkyRunner::log :info, "Run Task: #{task_args} Job: #{job_id} Message: #{message.id}"
83
+ if klass
84
+ SkyRunner::log :info, "Run Task: #{task_args} Job: #{job_id} Message: #{message.id}"
85
85
 
86
- job = klass.new
87
- job.skyrunner_job_id = job_id
86
+ job = klass.new
87
+ job.skyrunner_job_id = job_id
88
88
 
89
- begin
90
- job.consume!(task_args)
91
- message.delete
92
- rescue Exception => e
93
- error_queue.push(e)
94
- SkyRunner::log :error, "Task Failed: #{task_args} Job: #{job_id} #{e.message} #{e.backtrace.join("\n")}"
89
+ begin
90
+ job.consume!(task_args)
91
+ message.delete
92
+ rescue Exception => e
93
+ error_queue.push(e)
94
+ SkyRunner::log :error, "Task Failed: #{task_args} Job: #{job_id} #{e.message} #{e.backtrace.join("\n")}"
95
+ end
95
96
  end
96
97
  end
97
98
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skyrunner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Fodor