X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fsyncthing%2Fstfolder.go;h=e7ee0ec448e845da5e4b10837b958b8f0b74fb8b;hb=7f1db509a2076311c280964715962df71a1631ce;hp=d79e579eb6d4e2c5f022a83d5fe288ce14528802;hpb=ec7051e1da665206f594c7616ad381bfeaea333a;p=src%2Fxds%2Fxds-server.git diff --git a/lib/syncthing/stfolder.go b/lib/syncthing/stfolder.go index d79e579..e7ee0ec 100644 --- a/lib/syncthing/stfolder.go +++ b/lib/syncthing/stfolder.go @@ -4,21 +4,13 @@ import ( "path/filepath" "strings" + "github.com/iotbzh/xds-server/lib/xdsconfig" "github.com/syncthing/syncthing/lib/config" "github.com/syncthing/syncthing/lib/protocol" ) -// FIXME remove and use an interface on xdsconfig.FolderConfig -type FolderChangeArg struct { - ID string - Label string - RelativePath string - SyncThingID string - ShareRootDir string -} - // FolderChange is called when configuration has changed -func (s *SyncThing) FolderChange(f FolderChangeArg) error { +func (s *SyncThing) FolderChange(f xdsconfig.FolderConfig) error { // Get current config stCfg, err := s.ConfigGet() @@ -63,7 +55,11 @@ func (s *SyncThing) FolderChange(f FolderChangeArg) error { folder := config.FolderConfiguration{ ID: id, Label: label, - RawPath: filepath.Join(f.ShareRootDir, f.RelativePath), + RawPath: filepath.Join(s.conf.ShareRootDir, f.RelativePath), + } + + if s.conf.FileConf.SThgConf.RescanIntervalS > 0 { + folder.RescanIntervalS = s.conf.FileConf.SThgConf.RescanIntervalS } folder.Devices = append(folder.Devices, config.FolderDeviceConfiguration{