mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 11:28:59 +00:00
Start folders before GUI/API (fixes #1918)
This commit is contained in:
parent
a8b43ae598
commit
145f8c7435
@ -596,10 +596,6 @@ func syncthingMain() {
|
|||||||
m.StartDeadlockDetector(20 * 60 * time.Second)
|
m.StartDeadlockDetector(20 * 60 * time.Second)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GUI
|
|
||||||
|
|
||||||
setupGUI(mainSvc, cfg, m)
|
|
||||||
|
|
||||||
// Clear out old indexes for other devices. Otherwise we'll start up and
|
// Clear out old indexes for other devices. Otherwise we'll start up and
|
||||||
// start needing a bunch of files which are nowhere to be found. This
|
// start needing a bunch of files which are nowhere to be found. This
|
||||||
// needs to be changed when we correctly do persistent indexes.
|
// needs to be changed when we correctly do persistent indexes.
|
||||||
@ -611,7 +607,20 @@ func syncthingMain() {
|
|||||||
}
|
}
|
||||||
m.Index(device, folderCfg.ID, nil, 0, nil)
|
m.Index(device, folderCfg.ID, nil, 0, nil)
|
||||||
}
|
}
|
||||||
|
// Routine to pull blocks from other devices to synchronize the local
|
||||||
|
// folder. Does not run when we are in read only (publish only) mode.
|
||||||
|
if folderCfg.ReadOnly {
|
||||||
|
l.Okf("Ready to synchronize %s (read only; no external updates accepted)", folderCfg.ID)
|
||||||
|
m.StartFolderRO(folderCfg.ID)
|
||||||
|
} else {
|
||||||
|
l.Okf("Ready to synchronize %s (read-write)", folderCfg.ID)
|
||||||
|
m.StartFolderRW(folderCfg.ID)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GUI
|
||||||
|
|
||||||
|
setupGUI(mainSvc, cfg, m)
|
||||||
|
|
||||||
// The default port we announce, possibly modified by setupUPnP next.
|
// The default port we announce, possibly modified by setupUPnP next.
|
||||||
|
|
||||||
@ -636,18 +645,6 @@ func syncthingMain() {
|
|||||||
connectionSvc := newConnectionSvc(cfg, myID, m, tlsCfg)
|
connectionSvc := newConnectionSvc(cfg, myID, m, tlsCfg)
|
||||||
mainSvc.Add(connectionSvc)
|
mainSvc.Add(connectionSvc)
|
||||||
|
|
||||||
for _, folder := range cfg.Folders() {
|
|
||||||
// Routine to pull blocks from other devices to synchronize the local
|
|
||||||
// folder. Does not run when we are in read only (publish only) mode.
|
|
||||||
if folder.ReadOnly {
|
|
||||||
l.Okf("Ready to synchronize %s (read only; no external updates accepted)", folder.ID)
|
|
||||||
m.StartFolderRO(folder.ID)
|
|
||||||
} else {
|
|
||||||
l.Okf("Ready to synchronize %s (read-write)", folder.ID)
|
|
||||||
m.StartFolderRW(folder.ID)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if cpuProfile {
|
if cpuProfile {
|
||||||
f, err := os.Create(fmt.Sprintf("cpu-%d.pprof", os.Getpid()))
|
f, err := os.Create(fmt.Sprintf("cpu-%d.pprof", os.Getpid()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user