aboutsummaryrefslogtreecommitdiffstats
path: root/lib/syncthing/st.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/syncthing/st.go')
-rw-r--r--lib/syncthing/st.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/syncthing/st.go b/lib/syncthing/st.go
index 9bdb48f..10210a4 100644
--- a/lib/syncthing/st.go
+++ b/lib/syncthing/st.go
@@ -42,6 +42,7 @@ type SyncThing struct {
conf *xdsconfig.Config
client *common.HTTPClient
log *logrus.Logger
+ Events *Events
}
// ExitChan Channel used for process exit
@@ -126,6 +127,9 @@ func NewSyncThing(conf *xdsconfig.Config, log *logrus.Logger) *SyncThing {
conf: conf,
}
+ // Create Events monitoring
+ s.Events = s.NewEventListener()
+
return &s
}
@@ -316,6 +320,12 @@ func (s *SyncThing) Connect() error {
s.client.SetLogger(s.log)
s.MyID, err = s.IDGet()
+ if err != nil {
+ return fmt.Errorf("ERROR: cannot retrieve ID")
+ }
+
+ // Start events monitoring
+ err = s.Events.Start()
return err
}