external_resque_worker 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/external_resque_worker.rb +5 -1
  2. metadata +3 -3
@@ -4,6 +4,10 @@ class ExternalResqueWorker
4
4
  attr_accessor :pid, :startup_timeout
5
5
 
6
6
  def initialize
7
+ start
8
+ end
9
+
10
+ def start
7
11
  raise "PEDANTICALLY CODED TO ONLY WORK IN TEST ENV" unless Rails.env.test?
8
12
  install_hooks_on_startup
9
13
  if self.pid = fork
@@ -77,7 +81,7 @@ class ExternalResqueWorker
77
81
  end
78
82
 
79
83
  def worker_started?
80
- Resque.info[:workers].to_i > 0
84
+ Resque.workers.any? { |worker| worker.pid == self.pid }
81
85
  end
82
86
 
83
87
  def install_pause_on_start_hook
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: external_resque_worker
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Gordon