From e727242e909ce21ebb9e5639922c02a0a2673671 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Thu, 16 May 2024 18:14:57 -0400 Subject: [PATCH] Enable real sync deletions on client --- src/sync/client.go | 2 +- src/sync/common.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sync/client.go b/src/sync/client.go index b0a95ab..995af1e 100644 --- a/src/sync/client.go +++ b/src/sync/client.go @@ -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) } } diff --git a/src/sync/common.go b/src/sync/common.go index 7964954..50c3414 100644 --- a/src/sync/common.go +++ b/src/sync/common.go @@ -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)