3
0

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 9ac63876be
commit 150879200e

View File

@@ -413,9 +413,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
@@ -548,6 +545,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
}