Added extra sleep time to wait for download
This commit is contained in:
@@ -134,16 +134,17 @@ class Handler(watchdog.events.PatternMatchingEventHandler):
|
|||||||
|
|
||||||
fileExists = False
|
fileExists = False
|
||||||
timeout = 0
|
timeout = 0
|
||||||
|
|
||||||
while not fileExists:
|
while not fileExists:
|
||||||
fileExists = os.path.isfile(event.src_path)
|
fileExists = os.path.isfile(event.src_path)
|
||||||
time.sleep(1)
|
time.sleep(5)
|
||||||
timeout += 1
|
timeout += 1
|
||||||
|
|
||||||
if timeout > 60:
|
if timeout > 60:
|
||||||
logging.error('Timeout waiting for file {} to exist. Aborting processing.'.format(event.src_path))
|
logging.error('Timeout waiting for file {} to exist. Aborting processing.'.format(event.src_path))
|
||||||
return
|
return
|
||||||
|
|
||||||
historicalSize = -1
|
|
||||||
while (historicalSize != os.path.getsize(event.src_path)):
|
while (historicalSize != os.path.getsize(event.src_path)):
|
||||||
logging.info('waiting for copy to finish....')
|
logging.info('waiting for copy to finish....')
|
||||||
historicalSize = os.path.getsize(event.src_path)
|
historicalSize = os.path.getsize(event.src_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user