Enable real sync deletions on client

This commit is contained in:
2024-05-16 18:14:57 -04:00
parent 77726e9af3
commit 1ca55b8ac6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ func syncLists(localEntryModMap, remoteEntryModMap map[string]int64) {
func deletionSync(deletions []string) {
for _, deletion := range deletions {
fmt.Println(ansiDelete+deletion+backend.AnsiReset, "has been sheared, removing...")
//os.RemoveAll(backend.EntryRoot + deletion) TODO uncomment after testing
os.RemoveAll(backend.EntryRoot + deletion)
}
}
+1 -1
View File
@@ -62,7 +62,7 @@ func getModTimes(entryList []string) []int64 {
// if running on the server, it will also add the target to the deletions list
// if running on the client, it will call the server to add the target to the deletions list
func Shear(targetLocationIncomplete string, deviceID string) {
// get the full targetLocation path and remove the target TODO move so that the target is not removed if the server fails to add it to the deletions list
// get the full targetLocation path and remove the target TODO move so that the target is not removed if the server fails to add it to the deletions list, on server do not error if target does not exist
targetLocationComplete := backend.TargetLocationFormat(targetLocationIncomplete[1:])
backend.TargetIsFile(targetLocationComplete, true, 0) // needed because os.RemoveAll does not return an error if target does not exist
err := os.RemoveAll(targetLocationComplete)