Fixed xds-server folder events detection.
[src/xds/xds-agent.git] / lib / agent / agent.go
index 58a2ba0..989c9a0 100644 (file)
@@ -132,7 +132,10 @@ func (ctx *Context) Run() (int, error) {
                ctx._logPrint("Logging file for HTTP requests: %s\n", logFileHTTPReq)
        }
 
-       // Create syncthing instance when section "syncthing" is present in config.json
+       // Create events management
+       ctx.events = NewEvents(ctx)
+
+       // Create syncthing instance when section "syncthing" is present in agent-config.json
        if ctx.Config.FileConf.SThgConf != nil {
                ctx.SThg = st.NewSyncThing(ctx.Config, ctx.Log)
        }
@@ -186,9 +189,6 @@ func (ctx *Context) Run() (int, error) {
        // Sessions manager
        ctx.sessions = NewClientSessions(ctx, cookieMaxAge)
 
-       // Create events management
-       ctx.events = NewEvents(ctx)
-
        // Create projects management
        ctx.projects = NewProjects(ctx, ctx.SThg)