(app_name, job_id, q, timeout)
return True
Return True if valid job_id.
    If invalid, do whatever cleanup for this job is necessary and return False.
      --> necessary cleanup may include removing this job_id from queue
Return True if valid job_id.
    If invalid, do whatever cleanup for this job is necessary and return False.
      --> necessary cleanup may include removing this job_id from queue
Return True if valid job_id . If invalid do whatever cleanup for this job is necessary and return False . -- > necessary cleanup may include removing this job_id from queue
def validate_job_id(app_name, job_id, q, timeout):
    """Return True if valid job_id.
    If invalid, do whatever cleanup for this job is necessary and return False.
      --> necessary cleanup may include removing this job_id from queue
    """
    if job_id is None:
        log.info('No jobs found in %d seconds...' % timeout, extra=dict(
            app_name=app_name))
        return False
    try:
        dt.parse_job_id(app_name, job_id)
    except exceptions.InvalidJobId as err:
        log.error((
            "Stolos found an invalid job_id.  Removing it from queue"
            " and marking that job_id as failed.  Error details: %s") % err,
            extra=dict(app_name=app_name, job_id=job_id))
        q.consume()
        qb._set_state_unsafe(
            app_name, job_id, failed=True)
        return False
    return True
def validate_job_id ( app_name , job_id , q , timeout ) : if job_id is None : log . info ( 'No jobs found in %d seconds...' % timeout , extra = dict ( app_name = app_name ) ) return False try : dt . parse_job_id ( app_name , job_id ) except exceptions . InvalidJobId as err : log . error ( ( "Stolos found an invalid job_id.  Removing it from queue" " and marking that job_id as failed.  Error details: %s" ) % err , extra = dict ( app_name = app_name , job_id = job_id ) ) q . consume ( ) qb . _set_state_unsafe ( app_name , job_id , failed = True ) return False return True