File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -453,7 +453,7 @@ def inspect
453
453
# The string representation is the same as the id for this worker
454
454
# instance. Can be used with `Worker.find`.
455
455
def to_s
456
- @to_s ||= "#{ hostname } :#{ pid } :#{ @queues . join ( ',' ) } "
456
+ @to_s ||= "#{ hostname } :#{ Process . pid } :#{ @queues . join ( ',' ) } "
457
457
end
458
458
alias_method :id , :to_s
459
459
@@ -464,7 +464,7 @@ def hostname
464
464
465
465
# Returns PID of running worker
466
466
def pid
467
- @pid ||= Process . pid
467
+ @pid ||= to_s . split ( ":" ) [ 1 ] . to_i
468
468
end
469
469
470
470
# Returns an array of string pids of all the other workers on this
Original file line number Diff line number Diff line change 314
314
end
315
315
316
316
test "returns PID of running process" do
317
- assert_equal Process . pid , @worker . pid
317
+ assert_equal @worker . to_s . split ( ":" ) [ 1 ] . to_i , @worker . pid
318
318
end
319
319
end
You can’t perform that action at this time.
0 commit comments