1
0
Fork 0
mirror of https://github.com/Luzifer/cloudbox.git synced 2024-12-22 18:51:21 +00:00

Handle special case: Both sides deleted

This commit is contained in:
Knut Ahlers 2019-06-16 22:49:18 +02:00
parent b14ed6052f
commit d65571a245
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -26,7 +26,16 @@ func (s *Sync) decideAction(syncState *state, fileName string) error {
case change.HasAll(ChangeLocalDelete, ChangeRemoteDelete):
// Special case: Both vanished, we just need to clean up the sync cache
logger.Debug("File deleted locally as well as remotely")
// TODO: Handle special case
if err := s.deleteDBFileInfo(sideLocal, fileName); err != nil {
logger.WithError(err).Error("Unable to delete local file info")
return nil
}
if err := s.deleteDBFileInfo(sideRemote, fileName); err != nil {
logger.WithError(err).Error("Unable to delete remote file info")
return nil
}
case change.Is(ChangeLocalAdd) || change.Is(ChangeLocalUpdate):
logger.Debug("File added or changed locally, uploading...")