Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/chore.whBackendConfig+review-com…
Browse files Browse the repository at this point in the history
…ments' into chore.whBackendConfig+warehouse-handle-to-router
  • Loading branch information
achettyiitr committed Aug 8, 2023
2 parents 4f00a9d + fbbc869 commit d84af52
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions warehouse/warehouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -783,19 +783,23 @@ func Start(ctx context.Context, app app.App) error {
}
}()

g, gCtx := errgroup.WithContext(ctx)

tenantManager = &multitenant.Manager{
BackendConfig: backendconfig.DefaultBackendConfig,
}
rruntime.GoForWarehouse(func() {
tenantManager.Run(ctx)
g.Go(func() error {
tenantManager.Run(gCtx)
return nil
})

bcManager = newBackendConfigManager(
config.Default, wrappedDBHandle, tenantManager,
pkgLogger.Child("wh_bc_manager"),
)
rruntime.GoForWarehouse(func() {
bcManager.Start(ctx)
g.Go(func() error {
bcManager.Start(gCtx)
return nil
})

RegisterAdmin(bcManager, pkgLogger)
Expand All @@ -819,8 +823,6 @@ func Start(ctx context.Context, app app.App) error {
return fmt.Errorf("cannot setup pgnotifier: %w", err)
}

g, gCtx := errgroup.WithContext(ctx)

// Setting up reporting client
// only if standalone or embedded connecting to diff DB for warehouse
if (isStandAlone() && isMaster()) || (misc.GetConnectionString() != psqlInfo) {
Expand Down

0 comments on commit d84af52

Please sign in to comment.