def METHOD_NAME(context):
    """
  Check if the timestamp of the message is older than a given threshold. This
  will avoid infinite retry loops in case of failure.
  See: https://cloud.google.com/functions/docs/bestpractices/retries
  """
    timestamp = context.timestamp
    event_time = parser.parse(timestamp)
    event_age = (datetime.now(timezone.utc) - event_time).total_seconds()
    event_age_ms = event_age * 1000
    # Ignore events that are too old
    max_age_ms = 60000
    return event_age_ms > max_age_ms