Code Review
/
src
/
xds
/
xds-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add doc to create & start XDS AGL docker container.
[src/xds/xds-server.git]
/
lib
/
syncthing
/
stfolder.go
diff --git
a/lib/syncthing/stfolder.go
b/lib/syncthing/stfolder.go
index
d79e579
..
e7ee0ec
100644
(file)
--- a/
lib/syncthing/stfolder.go
+++ b/
lib/syncthing/stfolder.go
@@
-4,21
+4,13
@@
import (
"path/filepath"
"strings"
"path/filepath"
"strings"
+ "github.com/iotbzh/xds-server/lib/xdsconfig"
"github.com/syncthing/syncthing/lib/config"
"github.com/syncthing/syncthing/lib/protocol"
)
"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
// FolderChange is called when configuration has changed
-func (s *SyncThing) FolderChange(f
FolderChangeAr
g) error {
+func (s *SyncThing) FolderChange(f
xdsconfig.FolderConfi
g) error {
// Get current config
stCfg, err := s.ConfigGet()
// 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,
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{
}
folder.Devices = append(folder.Devices, config.FolderDeviceConfiguration{