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
498
498
# Returns an Array of string pids of all the other workers on this
499
499
# machine. Useful when pruning dead workers on startup.
500
500
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 |
502
502
line . split ( ' ' ) [ 0 ]
503
503
end
504
504
end
@@ -508,7 +508,7 @@ def linux_worker_pids
508
508
# Returns an Array of string pids of all the other workers on this
509
509
# machine. Useful when pruning dead workers on startup.
510
510
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 |
512
512
real_pid = line . split ( ' ' ) [ 0 ]
513
513
pargs_command = `pargs -a #{ real_pid } 2>/dev/null | grep [r]esque | grep -v "resque-web"`
514
514
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
285
285
end
286
286
end
287
287
288
+ test "worker_pids returns pids" do
289
+ known_workers = @worker . worker_pids
290
+ assert !known_workers . empty?
291
+ end
292
+
288
293
test "Processed jobs count" do
289
294
@worker . work ( 0 )
290
295
assert_equal 1 , Resque . info [ :processed ]
You can’t perform that action at this time.
0 commit comments