We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7dea194 commit a3b675aCopy full SHA for a3b675a
lib/resque/worker.rb
@@ -529,11 +529,21 @@ def pid
529
def worker_pids
530
if RUBY_PLATFORM =~ /solaris/
531
solaris_worker_pids
532
+ elsif RUBY_PLATFORM =~ /mingw32/
533
+ windows_worker_pids
534
else
535
linux_worker_pids
536
end
537
538
539
+ # Find Resque worker pids on Windows.
540
+ #
541
+ # Returns an Array of string pids of all the other workers on this
542
+ # machine. Useful when pruning dead workers on startup.
543
+ def windows_worker_pids
544
+ `tasklist /FI "IMAGENAME eq ruby.exe" /FO list`.split("\n").select { |line| line =~ /^PID:/}.collect{ |line| line.gsub /PID:\s+/, '' }
545
+ end
546
+
547
# Find Resque worker pids on Linux and OS X.
548
#
549
def linux_worker_pids
0 commit comments