(app_name, job_id, max_retry)
return exceeded_limit
Increment the retry count for the given task.  If the retry count is
    greater than the max allowed number of retries, set the tasks's state
    to failed.

    Returns False if task exceeded retry limit and True if the increment was
    fine
Increment the retry count for the given task.  If the retry count is
    greater than the max allowed number of retries, set the tasks's state
    to failed.
Increment the retry count for the given task . If the retry count is greater than the max allowed number of retries set the tasks s state to failed .
def inc_retry_count(app_name, job_id, max_retry):
    """Increment the retry count for the given task.  If the retry count is
    greater than the max allowed number of retries, set the tasks's state
    to failed.

    Returns False if task exceeded retry limit and True if the increment was
    fine
    """
    qbcli = shared.get_qbclient()
    path = join(shared.get_job_path(app_name, job_id), 'retry_count')
    if not qbcli.exists(path):
        qbcli.create(path, '0')
        cnt = 0
    else:
        cnt = int(qbcli.get(path))
    if cnt + 1 >= max_retry:
        set_state(app_name, job_id, failed=True)
        log.error(
            'Task retried too many times and is set as permanently failed.',
            extra=dict(retry_cnt=cnt, app_name=app_name, job_id=job_id))
        exceeded_limit = True
    else:
        exceeded_limit = False
    qbcli.set(path, str(cnt + 1))
    log.info('Task retry count increased',
             extra=dict(retry_cnt=cnt + 1, app_name=app_name, job_id=job_id))
    return exceeded_limit
def inc_retry_count ( app_name , job_id , max_retry ) : qbcli = shared . get_qbclient ( ) path = join ( shared . get_job_path ( app_name , job_id ) , 'retry_count' ) if not qbcli . exists ( path ) : qbcli . create ( path , '0' ) cnt = 0 else : cnt = int ( qbcli . get ( path ) ) if cnt + 1 >= max_retry : set_state ( app_name , job_id , failed = True ) log . error ( 'Task retried too many times and is set as permanently failed.' , extra = dict ( retry_cnt = cnt , app_name = app_name , job_id = job_id ) ) exceeded_limit = True else : exceeded_limit = False qbcli . set ( path , str ( cnt + 1 ) ) log . info ( 'Task retry count increased' , extra = dict ( retry_cnt = cnt + 1 , app_name = app_name , job_id = job_id ) ) return exceeded_limit