Module: Uc::Unicorn::Helper

Included in:
GradualShutdown, Init, ReadyEvent, ReadyWait
Defined in:
lib/uc/unicorn/helper.rb

Instance Method Summary collapse

Instance Method Details

#first_worker?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/uc/unicorn/helper.rb', line 9

def first_worker?
  worker.nr == 0
end

#last_worker?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/uc/unicorn/helper.rb', line 13

def last_worker?
  (worker.nr + 1) == server.worker_processes
end

#old_pidObject



17
18
19
# File 'lib/uc/unicorn/helper.rb', line 17

def old_pid
  "#{server.config[:pid]}.oldbin"
end

#restart?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/uc/unicorn/helper.rb', line 5

def restart?
  (File.readable? old_pid) && (server.pid != old_pid)
end