beanworker 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 0.0.5 2011-10-24
2
+
3
+ * 2 minor enhancements:
4
+ * bug in parameters for scheduled job
5
+ * better output on catched error
6
+
1
7
  === 0.0.4 2011-10-24
2
8
 
3
9
  * 1 minor enhancement:
data/lib/beanworker.rb CHANGED
@@ -5,7 +5,7 @@ require 'logger'
5
5
  require File.dirname(__FILE__) + '/beanworker/worker'
6
6
 
7
7
  module Beanworker
8
- VERSION = '0.0.4'
8
+ VERSION = '0.0.5'
9
9
 
10
10
  class << self
11
11
  attr_accessor :connection_config
@@ -40,14 +40,14 @@ module Beanworker
40
40
 
41
41
  def get_one_job(connection)
42
42
  job = connection.reserve
43
- name, args = job.stats['tube'].gsub('.', '_'), job.ybody
43
+ name, args = job.stats['tube'].gsub('.', '_'), [job.ybody]
44
44
  need_fork = args.delete('__fork__')
45
45
  work_job(name, job.ttr, args, need_fork.nil? ? @need_fork : need_fork)
46
46
  job.delete
47
47
  rescue SystemExit
48
48
  raise
49
49
  rescue => e
50
- logger.error e.backtrace.unshift(e.message)
50
+ logger.error e.backtrace.unshift(e.message).join("\n")
51
51
  job.bury rescue nil
52
52
  end
53
53
 
@@ -65,7 +65,7 @@ module Beanworker
65
65
 
66
66
  def work_with_timeout(name, ttr, args)
67
67
  Timeout::timeout(ttr - 1) do
68
- self.send(name, args)
68
+ self.send(name, *args)
69
69
  end
70
70
  end
71
71
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beanworker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-10-24 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beanstalk-client
16
- requirement: &22123460 !ruby/object:Gem::Requirement
16
+ requirement: &19912680 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *22123460
24
+ version_requirements: *19912680
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: beanqueue
27
- requirement: &22122860 !ruby/object:Gem::Requirement
27
+ requirement: &19910460 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.1.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *22122860
35
+ version_requirements: *19910460
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hoe
38
- requirement: &22095800 !ruby/object:Gem::Requirement
38
+ requirement: &19876520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '2.12'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *22095800
46
+ version_requirements: *19876520
47
47
  description: ! 'It is a worker-side Beanstalk-based job-queueing dispatcher
48
48
 
49
49