File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -498,7 +498,7 @@ def worker_pids
498498 # Returns an Array of string pids of all the other workers on this
499499 # machine. Useful when pruning dead workers on startup.
500500 def linux_worker_pids
501- `ps -A -o pid,command | grep [r]esque | grep -v "resque-web"` . split ( "\n " ) . map do |line |
501+ `ps -A -o pid,command | grep " [r]esque" | grep -v "resque-web"` . split ( "\n " ) . map do |line |
502502 line . split ( ' ' ) [ 0 ]
503503 end
504504 end
@@ -508,7 +508,7 @@ def linux_worker_pids
508508 # Returns an Array of string pids of all the other workers on this
509509 # machine. Useful when pruning dead workers on startup.
510510 def solaris_worker_pids
511- `ps -A -o pid,comm | grep [r]uby | grep -v "resque-web"` . split ( "\n " ) . map do |line |
511+ `ps -A -o pid,comm | grep " [r]uby" | grep -v "resque-web"` . split ( "\n " ) . map do |line |
512512 real_pid = line . split ( ' ' ) [ 0 ]
513513 pargs_command = `pargs -a #{ real_pid } 2>/dev/null | grep [r]esque | grep -v "resque-web"`
514514 if pargs_command . split ( ':' ) [ 1 ] == " resque-#{ Resque ::Version } "
Original file line number Diff line number Diff line change @@ -285,6 +285,11 @@ def self.exception
285285 end
286286 end
287287
288+ test "worker_pids returns pids" do
289+ known_workers = @worker . worker_pids
290+ assert !known_workers . empty?
291+ end
292+
288293 test "Processed jobs count" do
289294 @worker . work ( 0 )
290295 assert_equal 1 , Resque . info [ :processed ]
You can’t perform that action at this time.
0 commit comments