async def reevaluate(record): try: identifier = record.get("identifier") get_db_controller().update_status(identifier, status="REEVALUATING") data = dataEvaluation.process(record["data"]) get_db_controller().update(identifier, data=data, status="FINISHED") print(f":: Successfully reevaluated data for: {identifier}") except Exception as exception: print( f"Unknown error occurred while reevalutating record {identifier}: error: {exception}" ) get_db_controller().update_status(identifier, status="ERROR", other={"exception": str(exception)}) raise exception
async def _load_process_and_save(identifier): """Loads, processes and saves data from external api""" try: data = await async_fetch_all_data(identifier) print(f":: Successfully fetched data for: {identifier}") data = dataEvaluation.process(data) print(f":: Successfully processed data for: {identifier}") get_db_controller().update(identifier, data=data, status="FINISHED") except FetchError as fetchError: print(f"Error occurred while fetching: {fetchError}") get_db_controller().update(identifier, status="ERROR", other={"exception": str(exception)}) except Exception as exception: print(f"Unknown error occurred while fetching: {exception}") get_db_controller().update(identifier, status="ERROR", other={"exception": str(exception)}) raise exception
async def reevaluate(record): identifier = record.get("identifier") get_db_controller().update_status(identifier, status="REEVALUATING") data = dataEvaluation.process(record["data"]) print(f":: Successfully reevaluated data for: {identifier}") get_db_controller().update(identifier, data=data, status="FINISHED")