Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add config param for batch router for name customize #3461

Merged
merged 3 commits into from Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion router/batchrouter/handle.go
Expand Up @@ -89,6 +89,7 @@ type Handle struct {
warehouseServiceMaxRetryTime time.Duration
transformerURL string
datePrefixOverride string
customDatePrefix string

// state

Expand Down Expand Up @@ -407,7 +408,7 @@ func (brt *Handle) upload(provider string, batchJobs *BatchedJobs, isWarehouse b
default:
datePrefixLayout = time.Now().Format("2006-01-02")
}
keyPrefixes := []string{folderName, batchJobs.Connection.Source.ID, datePrefixLayout}
keyPrefixes := []string{folderName, batchJobs.Connection.Source.ID, brt.customDatePrefix + datePrefixLayout}

_, fileName := filepath.Split(gzipFilePath)
var (
Expand Down
1 change: 1 addition & 0 deletions router/batchrouter/handle_lifecycle.go
Expand Up @@ -108,6 +108,7 @@ func (brt *Handle) Setup(
config.RegisterDurationConfigVariable(3, &brt.warehouseServiceMaxRetryTime, true, time.Hour, []string{"BatchRouter.warehouseServiceMaxRetryTime", "BatchRouter.warehouseServiceMaxRetryTimeinHr"}...)
brt.transformerURL = config.GetString("DEST_TRANSFORM_URL", "http://localhost:9090")
config.RegisterStringConfigVariable("", &brt.datePrefixOverride, true, "BatchRouter.datePrefixOverride")
config.RegisterStringConfigVariable("", &brt.customDatePrefix, true, "BatchRouter.customDatePrefix")

ctx, cancel := context.WithCancel(context.Background())
brt.backgroundGroup, brt.backgroundCtx = errgroup.WithContext(ctx)
Expand Down