From 4695555e178bcabe54c5bf82117c9c4cef5440b5 Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Wed, 11 Oct 2017 00:24:02 +0200 Subject: Fixed Syncthing folder status events and exec command. --- lib/syncthing/st.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/syncthing/st.go') diff --git a/lib/syncthing/st.go b/lib/syncthing/st.go index 304cfca..924f407 100644 --- a/lib/syncthing/st.go +++ b/lib/syncthing/st.go @@ -119,7 +119,7 @@ func NewSyncThing(conf *xdsconfig.Config, log *logrus.Logger) *SyncThing { } // Create Events monitoring - // SEB TO TEST s.Events = s.NewEventListener() + s.Events = s.NewEventListener() return &s } @@ -130,7 +130,7 @@ func (s *SyncThing) startProc(exeName string, args []string, env []string, eChan var exePath string // Kill existing process (useful for debug ;-) ) - if os.Getenv("DEBUG_MODE") != "" { + if _, dbg := os.LookupEnv("XDS_DEBUG_MODE"); dbg { fmt.Printf("\n!!! DEBUG_MODE set: KILL existing %s process(es) !!!\n", exeName) exec.Command("bash", "-c", "ps -ax |grep "+exeName+" |grep "+s.BaseURL+" |cut -d' ' -f 1|xargs -I{} kill -9 {}").Output() } @@ -227,7 +227,7 @@ func (s *SyncThing) Start() (*exec.Cmd, error) { "STNOUPGRADE=1", } - /* SEB STILL NEEDED, if not SUP code + /* FIXME - STILL NEEDED ?, if not SUP code // XXX - temporary hack because -gui-apikey seems to correctly handle by // syncthing the early first time @@ -371,7 +371,7 @@ func (s *SyncThing) Connect() error { s.Connected = true // Start events monitoring - //SEB TODO err = s.Events.Start() + err = s.Events.Start() return err } -- cgit 1.2.3-korg