grr/server/grr_response_server/hunt.py
def CompleteHuntIfExpirationTimeReached(hunt_obj):
  """Marks the hunt as complete if it's past its expiry time."""

  if (hunt_obj.hunt_state not in [
      rdf_hunt_objects.Hunt.HuntState.STOPPED,
      rdf_hunt_objects.Hunt.HuntState.COMPLETED
  ] and hunt_obj.expiry_time < rdfvalue.RDFDatetime.Now()):
    StopHunt(hunt_obj.hunt_id, reason="Hunt completed.")

    def UpdateFn(h):
      h.hunt_state = h.HuntState.COMPLETED
      return h

    return data_store.REL_DB.UpdateHuntObject(hunt_obj.hunt_id, UpdateFn)

  return hunt_obj
Marks the hunt as complete if it's past its expiry time.
Marks the hunt as complete if it's past its expiry time.
Marks the hunt as complete if it ' s past its expiry time .
def CompleteHuntIfExpirationTimeReached(hunt_obj):
  if (hunt_obj.hunt_state not in [
      rdf_hunt_objects.Hunt.HuntState.STOPPED,
      rdf_hunt_objects.Hunt.HuntState.COMPLETED
  ] and hunt_obj.expiry_time < rdfvalue.RDFDatetime.Now()):
    StopHunt(hunt_obj.hunt_id, reason="Hunt completed.")
    def UpdateFn(h):
      h.hunt_state = h.HuntState.COMPLETED
      return h
    return data_store.REL_DB.UpdateHuntObject(hunt_obj.hunt_id, UpdateFn)
  return hunt_obj
def CompleteHuntIfExpirationTimeReached ( hunt_obj ) : if ( hunt_obj . hunt_state not in [ rdf_hunt_objects . Hunt . HuntState . STOPPED , rdf_hunt_objects . Hunt . HuntState . COMPLETED ] and hunt_obj . expiry_time < rdfvalue . RDFDatetime . Now ( ) ) : StopHunt ( hunt_obj . hunt_id , reason = "Hunt completed." ) def UpdateFn ( h ) : h . hunt_state = h . HuntState . COMPLETED return h return data_store . REL_DB . UpdateHuntObject ( hunt_obj . hunt_id , UpdateFn ) return hunt_obj
Marks the hunt as complete if it's past its expiry time.
Marks the hunt as complete if it ' s past its expiry time .
"""Marks the hunt as complete if it's past its expiry time."""
hunt_obj