🐛 fix(utils.py): add error handling for flow not found in cache when updating build status

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-09-27 12:37:12 -03:00
commit 91bfa9a5d3

View file

@ -207,5 +207,7 @@ def save_uploaded_file(file: UploadFile, folder_name):
def update_build_status(cache_service, flow_id: str, status: BuildStatus):
cached_flow = cache_service[flow_id]
if cached_flow is None:
raise ValueError(f"Flow {flow_id} not found in cache")
cached_flow["status"] = status
cache_service[flow_id] = cached_flow