Method: Resqued::Master#prepare_new_listener

Defined in:
lib/resqued/master.rb

#prepare_new_listenerObject

Private: Spin up a new listener.

The old one will be killed when the new one is ready for workers.



159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/resqued/master.rb', line 159

def prepare_new_listener
  if @listeners.last_good
    # The last good listener is still running because we got another
    # HUP before the new listener finished booting.
    # Keep the last_good_listener (where all the workers are) and
    # kill the booting current_listener. We'll start a new one.
    kill_listener(:QUIT, @listeners.current)
    # Indicate to `start_listener` that it should start a new
    # listener.
    @listeners.clear_current!
  else
    @listeners.cycle_current
  end
end