ayl-beanstalk 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ayl-beanstalk"
8
- s.version = "0.1.5"
8
+ s.version = "0.1.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["j0hnds@gmail.com"]
12
- s.date = "2012-10-16"
12
+ s.date = "2012-11-09"
13
13
  s.description = "Ayl extension to provide beanstalk support."
14
14
  s.email = "j0hnds@gmail.com"
15
15
  s.executables = ["ayl_beanstalk", "ayl_worker", "ayl_worker_control"]
@@ -8,7 +8,7 @@ require 'optparse'
8
8
  require 'beanstalk-client'
9
9
 
10
10
  SLEEP_COMMAND = {
11
- :type => :rails,
11
+ :type => :ayl,
12
12
  :code => 'Kernel.sleep(20)' # This message will cause the worker to sleep for 20 seconds
13
13
  }
14
14
 
@@ -135,6 +135,7 @@ class BeanstalkCommander
135
135
  def put_ayl_job(job_body)
136
136
  raise "Must specify a job body to put" unless job_body
137
137
  puts "Putting (#{job_body}) on tube: #{@tube}"
138
+ pool.use(@tube)
138
139
  pool.put({:type => :ayl, :code => job_body}.to_yaml)
139
140
  puts "Job was put"
140
141
  end
@@ -28,6 +28,12 @@ module Ayl
28
28
  rescue Ayl::UnrecoverableMessageException => ex
29
29
  logger.error "#{self.class.name} Unrecoverable exception in process_messages: #{ex}"
30
30
  job.delete
31
+ rescue SystemExit
32
+ # This exception is raised when 'Kernel.exit' is called. In this case
33
+ # we want to make sure the job is deleted, then we simply re-raise
34
+ # the exception and we go bye-bye.
35
+ job.delete
36
+ raise
31
37
  rescue Exception => ex
32
38
  logger.error "#{self.class.name} Exception in process_messages: #{ex}\n#{ex.backtrace.join("\n")}"
33
39
  logger.info "Age of job: #{job.age}"
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ayl-beanstalk
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.5
5
+ version: 0.1.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - j0hnds@gmail.com
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-10-16 00:00:00 Z
13
+ date: 2012-11-09 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ayl
@@ -150,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - ">="
152
152
  - !ruby/object:Gem::Version
153
- hash: -1909065726550082727
153
+ hash: -1188690675040961782
154
154
  segments:
155
155
  - 0
156
156
  version: "0"