(ns, q, lock)
The job has failed.  Increase it's retry limit, send to back of queue,
    and release the lock
The job has failed.  Increase it's retry limit, send to back of queue,
    and release the lock
The job has failed . Increase it s retry limit send to back of queue and release the lock
def _handle_failure(ns, q, lock):
    """The job has failed.  Increase it's retry limit, send to back of queue,
    and release the lock"""
    exceeded_retry_limit = qb.inc_retry_count(
        app_name=ns.app_name, job_id=ns.job_id, max_retry=ns.max_retry)
    if exceeded_retry_limit:
        q.consume()
    else:
        _send_to_back_of_queue(
            q=q, app_name=ns.app_name, job_id=ns.job_id)
    if lock:
        lock.release()
    log.warn("Job failed", extra=dict(
        job_id=ns.job_id, app_name=ns.app_name, failed=True))
def _handle_failure ( ns , q , lock ) : exceeded_retry_limit = qb . inc_retry_count ( app_name = ns . app_name , job_id = ns . job_id , max_retry = ns . max_retry ) if exceeded_retry_limit : q . consume ( ) else : _send_to_back_of_queue ( q = q , app_name = ns . app_name , job_id = ns . job_id ) if lock : lock . release ( ) log . warn ( "Job failed" , extra = dict ( job_id = ns . job_id , app_name = ns . app_name , failed = True ) )