def METHOD_NAME(job_key):
    """
    Waits until the current job is completed
    """
    global budget_keeper
    done = os.path.join(JOBS_DIR, job_key + '.done')
    while True:
        if os.path.isfile(done):
            os.remove(done)
            budget_keeper.jobs[job_key] = 'done'
            break
        time.sleep(1)