We collect files to move. Some cases another transfer can start and finish before this instance gets to the file. To not transfere duplicates we now check if the file exists with getFiles before we start a transfere. If its at the remote path we simply continue to the next file.

This commit is contained in:
2019-04-30 23:52:49 +02:00
parent 506a029a88
commit 3c976b398f

View File

@@ -33,6 +33,10 @@ def transferFiles(files, localPath, remotePath, host=None, user=None):
for file in files:
logger.info('Moving file: {}'.format(file))
if file in getFiles(remotePath, host, user):
logger.info('File already exists at remote path. Skipping.')
continue
file = os.path.join(localPath, file)
if (host and user):