Move API GW route init to activation level

Closes #495
This commit is contained in:
Denis Arh
2022-11-27 09:48:35 +01:00
parent ee0b18fb1b
commit d554447547
+5 -3
View File
@@ -418,9 +418,6 @@ func (app *CortezaApp) InitServices(ctx context.Context) (err error) {
// Initialize API GW bits
apigw.Setup(*options.Apigw(), app.Log, app.Store)
if err = apigw.Service().Reload(ctx); err != nil {
return fmt.Errorf("could not initialize api gateway services: %w", err)
}
if app.Opt.Federation.Enabled {
// Initializes federation services
@@ -556,6 +553,11 @@ func (app *CortezaApp) Activate(ctx context.Context) (err error) {
messagebus.Service().Watch(ctx, service.DefaultQueue)
}
// Reload routes
if err = apigw.Service().Reload(ctx); err != nil {
return fmt.Errorf("could not initialize api gateway services: %w", err)
}
app.lvl = bootLevelActivated
return nil
}