mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-28 04:46:42 -04:00
Do not call sftpSync if no entries need to be uploaded/downloaded
This commit is contained in:
+5
-3
@@ -256,7 +256,7 @@ func sftpSync(downloadList, uploadList []string, manualSync bool) {
|
|||||||
localFile.Close()
|
localFile.Close()
|
||||||
remoteFile.Close()
|
remoteFile.Close()
|
||||||
}
|
}
|
||||||
fmt.Println("\nClient is synchronized with server.")
|
fmt.Println("\nClient is synchronized with server")
|
||||||
}
|
}
|
||||||
|
|
||||||
// syncLists determines which entries need to be downloaded and uploaded for synchronizations and calls sftpSync with this information
|
// syncLists determines which entries need to be downloaded and uploaded for synchronizations and calls sftpSync with this information
|
||||||
@@ -292,8 +292,10 @@ func syncLists(localEntryModMap, remoteEntryModMap map[string]int64, manualSync
|
|||||||
}
|
}
|
||||||
|
|
||||||
// call sftpSync with the download and upload lists
|
// call sftpSync with the download and upload lists
|
||||||
fmt.Println() // add a gap between list-add messages and the actual sync messages from sftpSync
|
if max(len(downloadList), len(uploadList)) > 0 { // only call sftpSync if there are entries to download or upload
|
||||||
sftpSync(downloadList, uploadList, manualSync)
|
fmt.Println() // add a gap between list-add messages and the actual sync messages from sftpSync
|
||||||
|
sftpSync(downloadList, uploadList, manualSync)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShearRemoteFromClient removes the target file or directory from the local system and calls the server to remove it remotely and add it to the deletions list
|
// ShearRemoteFromClient removes the target file or directory from the local system and calls the server to remove it remotely and add it to the deletions list
|
||||||
|
|||||||
Reference in New Issue
Block a user