(app_name, job_id, queue=True, priority=None)
return True
Add a subtask to the queue if it hasn't been added yet.

    `queue` (bool, optional) - if False, don't add the subtask to queue
    `priority` (int, optional) - prioritize this item in the queue.
        1 is highest priority 100 is lowest priority.
        Irrelevant if `queue` is False
Add a subtask to the queue if it hasn't been added yet.
Add a subtask to the queue if it hasn t been added yet .
def maybe_add_subtask(app_name, job_id, queue=True, priority=None):
    """Add a subtask to the queue if it hasn't been added yet.

    `queue` (bool, optional) - if False, don't add the subtask to queue
    `priority` (int, optional) - prioritize this item in the queue.
        1 is highest priority 100 is lowest priority.
        Irrelevant if `queue` is False
    """
    qbcli = shared.get_qbclient()
    if qbcli.exists(shared.get_job_path(app_name, job_id)):
        return False
    # get a lock so we guarantee this task isn't being added twice concurrently
    lock = obtain_add_lock(app_name, job_id, blocking=False, safe=False)
    if not lock:
        return False
    try:
        _queue(app_name, job_id, queue=queue, priority=priority)
    finally:
        lock.release()
    return True
def maybe_add_subtask ( app_name , job_id , queue = True , priority = None ) : qbcli = shared . get_qbclient ( ) if qbcli . exists ( shared . get_job_path ( app_name , job_id ) ) : return False # get a lock so we guarantee this task isn't being added twice concurrently lock = obtain_add_lock ( app_name , job_id , blocking = False , safe = False ) if not lock : return False try : _queue ( app_name , job_id , queue = queue , priority = priority ) finally : lock . release ( ) return True