Method: Sensu::Server::Process#pause

Defined in:
lib/sensu/server/process.rb

#pauseObject

Pause the Sensu server process, unless it is being paused or has already been paused. The process/daemon ‘@state` is first set to `:pausing`, to indicate that it’s in progress. All run timers are cancelled, and the references are cleared. The Sensu server will unsubscribe from all transport subscriptions, resign as leader (if currently the leader), then set the process/daemon ‘@state` to `:paused`.



952
953
954
955
956
957
958
959
960
961
962
963
# File 'lib/sensu/server/process.rb', line 952

def pause
  unless @state == :pausing || @state == :paused
    @state = :pausing
    @timers[:run].each do |timer|
      timer.cancel
    end
    @timers[:run].clear
    unsubscribe
    resign_as_leader
    @state = :paused
  end
end