Skip to content

Commit

Permalink
Move resource locale initial load to boot proc
Browse files Browse the repository at this point in the history
  • Loading branch information
darh authored and tjerman committed Sep 22, 2021
1 parent a50c647 commit 75c5efb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 5 additions & 0 deletions app/boot_levels.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions system/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 75c5efb

Please sign in to comment.