(app_name, job_id)
return l
Return a lock instance or False.  If returning False,
    the job is not ready to execute.
Return a lock instance or False.  If returning False,
    the job is not ready to execute.
Return a lock instance or False . If returning False the job is not ready to execute .
def get_lock_if_job_is_runnable(app_name, job_id):
    """Return a lock instance or False.  If returning False,
    the job is not ready to execute.
    """

    available = qb.check_state(
        app_name, job_id, pending=True, raise_if_not_exists=True)
    if not available:
        try:
            raise RuntimeError(
                "I found a job in queue that wasn't"
                " in state pending. This might be a code bug. You"
                " probably queued 2+ of the same job!")
        except RuntimeError as err:
            # force a traceback in the logs
            log.exception(
                err, extra=dict(
                    app_name=app_name,
                    job_id=job_id,
                    state=qb.check_state(
                        app_name, job_id, _get=True)))
            return False
    l = qb.obtain_execute_lock(app_name, job_id, blocking=False)
    if l is False:
        log.warn('Could not obtain execute lock for task because'
                 ' something is already processing this job_id',
                 extra=dict(app_name=app_name, job_id=job_id))
        return False
    return l
def get_lock_if_job_is_runnable ( app_name , job_id ) : available = qb . check_state ( app_name , job_id , pending = True , raise_if_not_exists = True ) if not available : try : raise RuntimeError ( "I found a job in queue that wasn't" " in state pending. This might be a code bug. You" " probably queued 2+ of the same job!" ) except RuntimeError as err : # force a traceback in the logs log . exception ( err , extra = dict ( app_name = app_name , job_id = job_id , state = qb . check_state ( app_name , job_id , _get = True ) ) ) return False l = qb . obtain_execute_lock ( app_name , job_id , blocking = False ) if l is False : log . warn ( 'Could not obtain execute lock for task because' ' something is already processing this job_id' , extra = dict ( app_name = app_name , job_id = job_id ) ) return False return l