From ecb2eb5290a2b6bedfc486156c285c4e08684757 Mon Sep 17 00:00:00 2001 From: Sara Veldhoen Date: Thu, 26 Sep 2024 14:21:58 +0200 Subject: [PATCH] If file already exists, report back less than zero download_time --- download.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/download.py b/download.py index 473ae07..8116ea8 100644 --- a/download.py +++ b/download.py @@ -89,7 +89,9 @@ def s3_download(s3_uri: str) -> Optional[DownloadResult]: if not success: logger.error("Failed to download input data from S3") return None - download_time = (time.time() - start_time) * 1000 # time in ms + download_time = int((time.time() - start_time) * 1000) # time in ms + else: + download_time = -1 # Report back? return DownloadResult( input_file, mime_type, download_time # TODO add content_length )