diff --git a/app/boot_levels.go b/app/boot_levels.go index b7b201ef9..126bc2133 100644 --- a/app/boot_levels.go +++ b/app/boot_levels.go @@ -240,17 +240,19 @@ func (app *CortezaApp) InitServices(ctx context.Context) (err error) { PingPeriod: app.Opt.Websocket.PingPeriod, }) - // Initializes federation services - // - // Note: this is a legacy approach, all services from all 3 apps - // will most likely be merged in the future - err = fdrService.Initialize(ctx, app.Log, app.Store, fdrService.Config{ - ActionLog: app.Opt.ActionLog, - Federation: app.Opt.Federation, - }) + if app.Opt.Federation.Enabled { + // Initializes federation services + // + // Note: this is a legacy approach, all services from all 3 apps + // will most likely be merged in the future + err = fdrService.Initialize(ctx, app.Log, app.Store, fdrService.Config{ + ActionLog: app.Opt.ActionLog, + Federation: app.Opt.Federation, + }) - if err != nil { - return + if err != nil { + return + } } // Initialize external authentication (from default settings) @@ -314,7 +316,10 @@ func (app *CortezaApp) Activate(ctx context.Context) (err error) { sysService.Watchers(ctx) cmpService.Watchers(ctx) msgService.Watchers(ctx) - fedService.Watchers(ctx) + + if app.Opt.Federation.Enabled { + fedService.Watchers(ctx) + } rbac.Global().Watch(ctx) diff --git a/federation/service/service.go b/federation/service/service.go index baaddf4ca..be7344897 100644 --- a/federation/service/service.go +++ b/federation/service/service.go @@ -95,10 +95,6 @@ func Initialize(ctx context.Context, log *zap.Logger, s store.Storer, c Config) } func Watchers(ctx context.Context) { - if !DefaultOptions.Enabled { - return - } - DefaultLogger.Info("Starting federation - warning, this is still an experimental feature") syncService := NewSync(