app/models/agent.rb
def async_check(agent_id)
      agent = Agent.find(agent_id)
      begin
        agent.check
        agent.last_check_at = Time.now
        agent.save!
      rescue => e
        agent.error "Exception during check: #{e.message} -- #{e.backtrace}"
        raise
      end
    end
# Given an Agent id, load the Agent, call #check on it, and then save it with an updated `last_check_at` timestamp.
#
# This method is tagged with `handle_asynchronously` and will be delayed and run with delayed_job.  It accepts an Agent
# id instead of a literal Agent because it is preferable to serialize delayed_jobs with ids, instead of with the full
# Agents.
Given an Agent id, load the Agent, call #check on it, and then save it with an updated `last_check_at` timestamp.
This method is tagged with `handle_asynchronously` and will be delayed and run with delayed_job.  It accepts an Agent
id instead of a literal Agent because it is preferable to serialize delayed_jobs with ids, instead of with the full
Agents.
Given an Agent id load the Agent call #check on it and then save it with an updated ` last_check_at ` timestamp . This method is tagged with ` handle_asynchronously ` and will be delayed and run with delayed_job . It accepts an Agent id instead of a literal Agent because it is preferable to serialize delayed_jobs with ids instead of with the full Agents .
def async_check(agent_id)
      agent = Agent.find(agent_id)
      begin
        agent.check
        agent.last_check_at = Time.now
        agent.save!
      rescue => e
        agent.error "Exception during check: #{e.message} -- #{e.backtrace}"
        raise
      end
    end
def async_check ( agent_id ) agent = Agent . find ( agent_id ) begin agent . check agent . last_check_at = Time . now agent . save! rescue => e agent . error "Exception during check: #{e.message} -- #{e.backtrace}" raise end end
Given an Agent id, load the Agent, call #check on it, and then save it with an updated `last_check_at` timestamp.
Given an Agent id load the Agent call #check on it and then save it with an updated ` last_check_at ` timestamp .
agent_id