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 f6cb961
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions warehouse/warehouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import (
"sync"
"time"

"github.com/rudderlabs/rudder-server/rruntime"

"github.com/bugsnag/bugsnag-go/v2"
"github.com/cenkalti/backoff/v4"
"github.com/go-chi/chi/v5"
Expand Down Expand Up @@ -783,19 +781,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 +821,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 f6cb961

Please sign in to comment.