From 56d4354b53351ec09682fe08180b737ee6efdf55 Mon Sep 17 00:00:00 2001 From: Shane Frischkorn Date: Mon, 7 Feb 2022 12:48:28 +1000 Subject: [PATCH] Added extra sleep time to wait for download --- converter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/converter.py b/converter.py index d8ed547..72d593e 100644 --- a/converter.py +++ b/converter.py @@ -134,16 +134,17 @@ class Handler(watchdog.events.PatternMatchingEventHandler): fileExists = False timeout = 0 + while not fileExists: fileExists = os.path.isfile(event.src_path) - time.sleep(1) + time.sleep(5) timeout += 1 if timeout > 60: logging.error('Timeout waiting for file {} to exist. Aborting processing.'.format(event.src_path)) return - historicalSize = -1 + while (historicalSize != os.path.getsize(event.src_path)): logging.info('waiting for copy to finish....') historicalSize = os.path.getsize(event.src_path)