From 8f44cc7217ce48f3f94c8ea3f037cdf011c4493b Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Fri, 18 Aug 2017 01:04:02 +0200 Subject: Add folder synchronization status. Also add ability to force re-synchronization. --- lib/syncthing/stfolder.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/syncthing/stfolder.go') diff --git a/lib/syncthing/stfolder.go b/lib/syncthing/stfolder.go index bbdcc43..70ac70a 100644 --- a/lib/syncthing/stfolder.go +++ b/lib/syncthing/stfolder.go @@ -191,13 +191,11 @@ func (s *SyncThing) FolderStatus(folderID string) (*FolderStatus, error) { // IsFolderInSync Returns true when folder is in sync func (s *SyncThing) IsFolderInSync(folderID string) (bool, error) { - // FIXME better to detected FolderCompletion event (/rest/events) - // See https://docs.syncthing.net/dev/events.html sts, err := s.FolderStatus(folderID) if err != nil { return false, err } - return sts.NeedBytes == 0, nil + return sts.NeedBytes == 0 && sts.State == "idle", nil } // FolderScan Request immediate folder scan. -- cgit 1.2.3-korg