beanstalker 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.5
1
+ 0.3.6
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{beanstalker}
8
- s.version = "0.3.5"
8
+ s.version = "0.3.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gleb Pomykalov"]
12
- s.date = %q{2010-07-15}
12
+ s.date = %q{2010-07-16}
13
13
  s.description = %q{Beanstalker is a tool for executing long tasks in background in our rails application.}
14
14
  s.email = %q{glebpom@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -72,9 +72,19 @@ class Beanstalker::Worker
72
72
  end
73
73
 
74
74
  def startup
75
- tube = @options[:tube] || "default"
76
- logger.info "Using tube #{tube}"
77
- Beanstalker::Queue.queue.watch(tube)
75
+ tubes = Array.wrap(@options[:tube].to_s || "default") #["default"]
76
+ watched_tubes = Beanstalker::Queue.queue.list_tubes_watched.values.flatten #["default"]
77
+ to_watch = tubes - watched_tubes
78
+ to_ignore = watched_tubes - tubes
79
+ logger.debug "to_watch = #{to_watch.join(',')}"
80
+ logger.debug "to_ignore = #{to_ignore.join(',')}"
81
+ to_watch.each do |t|
82
+ Beanstalker::Queue.queue.watch(t)
83
+ end
84
+ to_ignore.each do |t|
85
+ Beanstalker::Queue.queue.ignore(t)
86
+ end
87
+ logger.info "Using tubes: #{Beanstalker::Queue.queue.list_tubes_watched.values.flatten.join(',')}"
78
88
  Daemonizer.flush_logger
79
89
  end
80
90
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beanstalker
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 5
10
- version: 0.3.5
9
+ - 6
10
+ version: 0.3.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gleb Pomykalov
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-15 00:00:00 +04:00
18
+ date: 2010-07-16 00:00:00 +04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency