3
0

Move resource locale initial load to boot proc

This commit is contained in:
Denis Arh 2021-09-15 07:54:34 +02:00 committed by Tomaž Jerman
parent a50c64747e
commit 75c5efb520
2 changed files with 5 additions and 6 deletions

View File

@ -351,6 +351,11 @@ func (app *CortezaApp) InitServices(ctx context.Context) (err error) {
rbac.SetGlobal(ac)
}
locale.Global().BindStore(app.Store)
if err = locale.Global().ReloadResourceTranslations(ctx); err != nil {
return err
}
if app.Opt.Messagebus.Enabled {
// initialize all the queue handlers
messagebus.Service().Init(ctx, app.Store)

View File

@ -10,7 +10,6 @@ import (
"github.com/cortezaproject/corteza-server/pkg/eventbus"
"github.com/cortezaproject/corteza-server/pkg/healthcheck"
"github.com/cortezaproject/corteza-server/pkg/id"
"github.com/cortezaproject/corteza-server/pkg/locale"
"github.com/cortezaproject/corteza-server/pkg/logger"
"github.com/cortezaproject/corteza-server/pkg/objstore"
"github.com/cortezaproject/corteza-server/pkg/objstore/minio"
@ -183,11 +182,6 @@ func Initialize(ctx context.Context, log *zap.Logger, s store.Storer, ws websock
return err
}
locale.Global().BindStore(DefaultStore)
if err = locale.Global().ReloadResourceTranslations(ctx); err != nil {
return err
}
automationService.DefaultUser = DefaultUser
automationService.Registry().AddTypes(