summaryrefslogtreecommitdiffstats
path: root/lib/db/set.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/db/set.go')
-rw-r--r--lib/db/set.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/db/set.go b/lib/db/set.go
index a1c0cb6496..12a7083cb8 100644
--- a/lib/db/set.go
+++ b/lib/db/set.go
@@ -144,6 +144,22 @@ func (s *FileSet) Update(device protocol.DeviceID, fs []protocol.FileInfo) {
}
}
+func (s *FileSet) RemoveLocalItems(items []string) {
+ opStr := fmt.Sprintf("%s RemoveLocalItems([%d])", s.folder, len(items))
+ l.Debugf(opStr)
+
+ s.updateMutex.Lock()
+ defer s.updateMutex.Unlock()
+
+ for i := range items {
+ items[i] = osutil.NormalizedFilename(items[i])
+ }
+
+ if err := s.db.removeLocalFiles([]byte(s.folder), items, s.meta); err != nil && !backend.IsClosed(err) {
+ fatalError(err, opStr, s.db)
+ }
+}
+
type Snapshot struct {
folder string
t readOnlyTransaction