S K
02/26/2021, 8:02 PM@task()
def mainprocess(a):
global df_single_record
try:
for indx in df_data_extracted.index + 1:
df_single_record = df_data_extracted.iloc[indx - 1:indx]
converttojson(df_single_record)
postjsontoqapi(df_json_data)
except Exception as e:
logger = get_logger()
logger.error(str(get_pst_time())
+ '==========ERROR IN mainprocess() WHILE CONVERTING TO JSON/POSTING TO Q-API: '
+ str(e))
raise SystemExit(0)
Zanie
SystemExit
is a reserved exception type https://docs.python.org/3/library/exceptions.html#SystemExitZanie
S K
02/26/2021, 8:28 PMZanie
raise FAIL()
) https://docs.prefect.io/core/concepts/execution.html#state-signalsS K
02/26/2021, 9:57 PMZanie
Zanie
S K
02/26/2021, 10:01 PMS K
02/26/2021, 10:05 PMwith Flow('flow_name', storage=Local()) as flow:
check_if_flow_is_running()
getdata = readssmandextractdata()
vmainprocess = mainprocess(getdata)
updatecontroltable(vmainprocess)
flow.run()
@Zanie This is how I am executing the tasksS K
02/26/2021, 10:18 PMcheckflow = check_if_flow_is_running()
getdata = readssmandextractdata(checkflow)
mainlogic = mainprocess(getdata)
updatecontroltable(mainlogic)
@Zanie thx much, able to stop the flow by doing as above...Zanie