Skip to content

Commit

Permalink
chore: support replay with new file format (#3834)
Browse files Browse the repository at this point in the history
  • Loading branch information
cisse21 committed Sep 26, 2023
1 parent 741fd74 commit 5c76185
Show file tree
Hide file tree
Showing 16 changed files with 784 additions and 515 deletions.
10 changes: 8 additions & 2 deletions app/apphandlers/embeddedAppHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,14 @@ func (a *embeddedApp) StartRudderCore(ctx context.Context, options *app.Options)
if err != nil {
return fmt.Errorf("could not setup replayDB: %w", err)
}
defer replayDB.TearDown()
a.app.Features().Replay.Setup(ctx, &replayDB, gatewayDB, routerDB, batchRouterDB)
replay, err := a.app.Features().Replay.Setup(ctx, config, &replayDB, gatewayDB, routerDB, batchRouterDB)
if err != nil {
return err
}
if err := replay.Start(); err != nil {
return fmt.Errorf("could not start replay: %w", err)
}
defer func() { _ = replay.Stop() }()
}

g.Go(func() error {
Expand Down
4 changes: 3 additions & 1 deletion app/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ package app
import (
"context"

"github.com/rudderlabs/rudder-go-kit/config"
backendconfig "github.com/rudderlabs/rudder-server/backend-config"
"github.com/rudderlabs/rudder-server/enterprise/replay"
"github.com/rudderlabs/rudder-server/jobsdb"
"github.com/rudderlabs/rudder-server/utils/types"
)
Expand Down Expand Up @@ -40,7 +42,7 @@ Replay Feature

// ReplayFeature handles inserting of failed jobs into respective gw/rt jobsdb
type ReplayFeature interface {
Setup(ctx context.Context, replayDB, gwDB, routerDB, batchRouterDB *jobsdb.Handle)
Setup(ctx context.Context, config *config.Config, replayDB, gwDB, routerDB, batchRouterDB *jobsdb.Handle) (replay.Replay, error)
}

// ReplayFeatureSetup is a function that initializes a Replay feature
Expand Down
267 changes: 0 additions & 267 deletions enterprise/replay/dumpsloader.go

This file was deleted.

Loading

0 comments on commit 5c76185

Please sign in to comment.