From 45b1c78bff82d16f0cbce3cbade61e10ef5c01e8 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Mon, 27 Jun 2022 18:36:43 +0300 Subject: [PATCH] Fix remove_temp_files --- app/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index e7f3dce..1a15ad8 100644 --- a/app/main.py +++ b/app/main.py @@ -106,7 +106,11 @@ def remove_temp_files(): is_file = os.path.isfile(target_path) - creation_time = os.path.getctime(target_path) + try: + creation_time = os.path.getctime(target_path) + except FileNotFoundError: + continue + if (current_time - creation_time) // 3600 >= 3: if is_file: os.remove(target_path)