From bd5a64bac08a707f26fe984a9da742fa4c94fdad Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sun, 3 May 2015 14:18:50 +0200 Subject: [PATCH] Reschedule before scan --- cmd/syncthing/gui.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index 7e91f9c7..a5e046e4 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -775,8 +775,14 @@ func (s *apiSvc) postDBScan(w http.ResponseWriter, r *http.Request) { qs := r.URL.Query() folder := qs.Get("folder") if folder != "" { + nextStr := qs.Get("next") + next, err := strconv.Atoi(nextStr) + if err == nil { + s.model.DelayScan(folder, time.Duration(next)*time.Second) + } + subs := qs["sub"] - err := s.model.ScanFolderSubs(folder, subs) + err = s.model.ScanFolderSubs(folder, subs) if err != nil { http.Error(w, err.Error(), 500) return @@ -789,11 +795,6 @@ func (s *apiSvc) postDBScan(w http.ResponseWriter, r *http.Request) { return } } - nextStr := qs.Get("next") - next, err := strconv.Atoi(nextStr) - if err == nil { - s.model.DelayScan(folder, time.Duration(next)*time.Second) - } } func (s *apiSvc) postDBPrio(w http.ResponseWriter, r *http.Request) {