lib/sensu/server/process.rb
# Relinquish a Sensu server task. This method cancels and
# clears the associated task timers, those with references
# stored in the timers hash under `:tasks`, and removes the task
# from `@tasks`. The task server ID and lock are not removed
# from Redis, as they will be updated when another server takes
# reponsibility for the task, this method does not need to
# handle Redis connectivity issues.
#
# @param task [String]
Relinquish a Sensu server task. This method cancels and
clears the associated task timers, those with references
stored in the timers hash under `:tasks`, and removes the task
from `@tasks`. The task server ID and lock are not removed
from Redis, as they will be updated when another server takes
reponsibility for the task, this method does not need to
handle Redis connectivity issues.
Relinquish a Sensu server task . This method cancels and clears the associated task timers those with references stored in the timers hash under ` : tasks ` and removes the task from ` @tasks ` . The task server ID and lock are not removed from Redis as they will be updated when another server takes reponsibility for the task this method does not need to handle Redis connectivity issues .
def relinquish_task(task)
        if @tasks.include?(task)
          @logger.warn("relinquishing server task", :task => task)
          @timers[:tasks][task.to_sym].each do |timer|
            timer.cancel
          end
          @timers[:tasks][task.to_sym].clear
          @tasks.delete(task)
        else
          @logger.debug("not currently responsible for a server task", :task => task)
        end
      end
def relinquish_task ( task ) if @tasks . include? ( task ) @logger . warn ( "relinquishing server task" , :task => task ) @timers [ :tasks ] [ task . to_sym ] . each do | timer | timer . cancel end @timers [ :tasks ] [ task . to_sym ] . clear @tasks . delete ( task ) else @logger . debug ( "not currently responsible for a server task" , :task => task ) end end
Relinquish a Sensu server task.
Relinquish a Sensu server task .
task
None