File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ STALE_EXEMPTIONS = ["imports"]
7
7
Thread . new do
8
8
loop do
9
9
begin
10
- lines = `ps -e -o pid,command | grep [r]esque` . split ( " \n " )
10
+ lines = `ps -e -o pid,command | grep [r]esque` . split ( $/ )
11
11
lines . each do |line |
12
12
parts = line . split ( ' ' )
13
13
next if parts [ -2 ] != "at"
Original file line number Diff line number Diff line change @@ -566,7 +566,7 @@ def worker_pids
566
566
# Returns an Array of string pids of all the other workers on this
567
567
# machine. Useful when pruning dead workers on startup.
568
568
def windows_worker_pids
569
- `tasklist /FI "IMAGENAME eq ruby.exe" /FO list` . split ( " \n " ) . select { |line | line =~ /^PID:/ } . collect { |line | line . gsub /PID:\s +/ , '' }
569
+ `tasklist /FI "IMAGENAME eq ruby.exe" /FO list` . split ( $/ ) . select { |line | line =~ /^PID:/ } . collect { |line | line . gsub /PID:\s +/ , '' }
570
570
end
571
571
572
572
# Find Resque worker pids on Linux and OS X.
@@ -589,7 +589,7 @@ def get_worker_pids(command)
589
589
active_worker_pids = [ ]
590
590
output = %x[#{ command } ] # output format of ps must be ^<PID> <COMMAND WITH ARGS>
591
591
raise 'System call for ps command failed. Please make sure that you have a compatible ps command in the path!' unless $?. success?
592
- output . split ( " \n " ) . each { |line |
592
+ output . split ( $/ ) . each { |line |
593
593
next unless line =~ /resque/i
594
594
next if line =~ /resque-web/
595
595
active_worker_pids . push line . split ( ' ' ) [ 0 ]
Original file line number Diff line number Diff line change 31
31
32
32
exit_code = MiniTest ::Unit . new . run ( ARGV )
33
33
34
- processes = `ps -A -o pid,command | grep [r]edis-test` . split ( " \n " )
34
+ processes = `ps -A -o pid,command | grep [r]edis-test` . split ( $/ )
35
35
pids = processes . map { |process | process . split ( " " ) [ 0 ] }
36
36
puts "Killing test redis server..."
37
37
pids . each { |pid | Process . kill ( "TERM" , pid . to_i ) }
You can’t perform that action at this time.
0 commit comments