summaryrefslogtreecommitdiffstats
path: root/lib/syncthing/stfolder.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-08-18 01:04:02 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-08-18 01:04:02 +0200
commit8f44cc7217ce48f3f94c8ea3f037cdf011c4493b (patch)
treea93c483370e6ad64a7440241cfb7c21beb6021ba /lib/syncthing/stfolder.go
parent4feef5296bf3aea331fdde4cd7b94ee2322a907e (diff)
Add folder synchronization status.
Also add ability to force re-synchronization.
Diffstat (limited to 'lib/syncthing/stfolder.go')
-rw-r--r--lib/syncthing/stfolder.go4
1 files changed, 1 insertions, 3 deletions
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.