SyncServer - handle possible race condition

This might throw FileNotFoundError for missing file if progress check is faster than file creation
This commit is contained in:
Petr Kalis 2021-05-18 12:34:18 +02:00
parent 2de2f20bdf
commit e062d960b3

View file

@ -170,7 +170,10 @@ class LocalDriveHandler(AbstractProvider):
site=site,
progress=status_val
)
target_file_size = os.path.getsize(target_path)
try:
target_file_size = os.path.getsize(target_path)
except FileNotFoundError:
pass
time.sleep(0.5)
def _normalize_site_name(self, site_name):