Esempio n. 1
0
def change_job_status_to_cancelled_before_execution(id, conn_and_cursor=None):
    try:
        main.update_job_into_db(id, "CANCELLED_BEFORE_EXECUTION", "", None, "",
                                "", conn_and_cursor)
    except Exception as e:
        print("fail to update job status CANCELLED_BEFORE_EXECUTION", e)
        raise e
Esempio n. 2
0
def change_job_status_to_killed(id, conn_and_cursor=None):
    try:
        main.update_job_into_db(id, "KILLED", "", None, CURRENT_HOST,
                                conn_and_cursor)
    except Exception as e:
        print("fail to update job status KILLED", e)
        raise e
Esempio n. 3
0
def change_job_status_to_processing(id, conn_and_cursor=None):
    try:
        main.update_job_into_db(id, "PROCESSING", "", None, CURRENT_HOST,
                                conn_and_cursor)
    except Exception as e:
        print("fail to update job status PROCESSING", e)
        raise e
Esempio n. 4
0
def change_job_status_to_error(id, error_msg, conn_and_cursor=None):
    try:
        error_msg = error_msg.replace("'", "").replace("\"", "")
        main.update_job_into_db(id, "ERROR", error_msg, None, CURRENT_HOST,
                                conn_and_cursor)
    except Exception as e:
        print("fail to update job status ERROR", e)
        raise e
Esempio n. 5
0
def change_job_status_to_finished(id, conn_and_cursor=None):
    try:
        job_status = main.get_job_status(id)
        #dont update if job is killed or canceled
        if (job_status == "KILLED"
                or job_status == "CANCELLED_BEFORE_EXECUTION"):
            return

        main.update_job_into_db(id, "FINISHED", "", None, CURRENT_HOST,
                                conn_and_cursor)
    except Exception as e:
        print("fail to update job status FINISHED", e)
        raise e
Esempio n. 6
0
def change_job_status_to_error_during_enqueue(job_id, conn_and_cursor = None):
    try:
        main.update_job_into_db(job_id, "ERROR_ENQUEUE", "", None, None, None, conn_and_cursor)
    except Exception as e:
        print("fail to update job status", e)
        raise e