Esempio n. 1
0
    logging.exception(stat)
    c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, err, stag, stat))
    c_log.callproc('BMR_LOG.UPDATE_PROCESS_RUN_DTL', (l_run_id, 'F'))
    c_trunc.close()
    c_log.close()
    conn.close()
    hdlr.close()
    sys.exit()

# call active artifacts function--

c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, info, stag + ' - Active Artifacts START', ''))
start = time.perf_counter()
c1 = conn.cursor()
try:
    get_active_artifacts(l_run_id, c_log, c1, entity_type, sql_active_artifacts_test_set, hdlr)
    c1.close()
    finish = time.perf_counter() - start
    stat = f'Active Artifacts load finished in {round(finish, 2)} second(s)'
    c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, info, stag + ' - Active Artifacts END', stat))
except Exception:
    stat = "Active artifacts fetch failed. Check previous errors/log file"
    logging.exception(stat)
    c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, err, stag + ' - Active Artifacts', stat))
    c_log.callproc('BMR_LOG.UPDATE_PROCESS_RUN_DTL', (l_run_id, 'F'))
    c_log.close()
    c1.close()
    conn.close()
    hdlr.close()
    sys.exit()
Esempio n. 2
0
    logging.exception(stat)
    c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, err, stag, stat))
    c_log.callproc('BMR_LOG.UPDATE_PROCESS_RUN_DTL', (l_run_id, 'F'))
    c_trunc.close()
    c_log.close()
    conn.close()
    hdlr.close()
    sys.exit()

# call active artifacts function--

c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, info, stag + ' - Active Artifacts START', ''))
start = time.perf_counter()
c1 = conn.cursor()
try:
    get_active_artifacts(l_run_id, c_log, c1, entity_type, sql_active_artifacts_defect, hdlr)
    c1.close()
    finish = time.perf_counter() - start
    stat = f'Active Artifacts load finished in {round(finish, 2)} second(s)'
    c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, info, stag + ' - Active Artifacts END', stat))
except:
    stat = "Active artifacts fetch failed. Check previous errors/log file"
    logging.exception(stat)
    c_log.callproc('BMR_LOG.INSERT_PROCESS_RUN_LOG_DTL', (l_run_id, err, stag + ' - Active Artifacts', stat))
    c_log.callproc('BMR_LOG.UPDATE_PROCESS_RUN_DTL', (l_run_id, 'F'))
    c_log.close()
    c1.close()
    conn.close()
    hdlr.close()
    sys.exit()