diff --git a/core/cfapi/filesystem/synclocaltoremote.go b/core/cfapi/filesystem/synclocaltoremote.go index 2059cbe..32908e2 100644 --- a/core/cfapi/filesystem/synclocaltoremote.go +++ b/core/cfapi/filesystem/synclocaltoremote.go @@ -45,8 +45,6 @@ func (instance *VirtualizationInstance) isDeletedRemotely(remotepath string, loc } func (instance *VirtualizationInstance) syncLocalToRemote() error { - instance.lock.Lock() - defer instance.lock.Unlock() return filepath.Walk(instance.rootPath, func(localpath string, localinfo fs.FileInfo, err error) error { instance.Logger.Debug().Msgf("Syncing local file '%s'", localpath) if os.IsNotExist(err) { @@ -84,7 +82,7 @@ func (instance *VirtualizationInstance) syncLocalToRemote() error { remoteinfo, err := instance.fs.Stat(path) var localisnewer bool if os.IsNotExist(err) { - localisnewer = false + localisnewer = true } else if err != nil { return fmt.Errorf("syncLocalToRemote.1 %w", err) } else if remoteinfo == nil { @@ -107,7 +105,6 @@ func (instance *VirtualizationInstance) syncLocalToRemote() error { } // mark file as in-sync return instance.setInSync(localpath) - } if deleted { diff --git a/core/cfapi/filesystem/syncremotetolocal.go b/core/cfapi/filesystem/syncremotetolocal.go index 27978d3..8c02435 100644 --- a/core/cfapi/filesystem/syncremotetolocal.go +++ b/core/cfapi/filesystem/syncremotetolocal.go @@ -14,8 +14,6 @@ import ( ) func (instance *VirtualizationInstance) syncRemoteToLocal() error { - instance.lock.Lock() - defer instance.lock.Unlock() return utils.Walk(instance.fs, "", func(path string, remoteinfo fs.FileInfo, err error) error { instance.Logger.Debug().Msgf("Syncing remote file '%s'", path) if os.IsNotExist(err) {