From d554447547b4e5794dab4f2aee4d22153a27ef41 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Sun, 27 Nov 2022 09:48:35 +0100 Subject: [PATCH] Move API GW route init to activation level Closes #495 --- server/app/boot_levels.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/app/boot_levels.go b/server/app/boot_levels.go index 7c852ff74..b599298c9 100644 --- a/server/app/boot_levels.go +++ b/server/app/boot_levels.go @@ -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 }