Skip to content

Commit

Permalink
minor rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
piyushdatazip committed Nov 7, 2024
1 parent e8d5350 commit 402b11b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions protocol/writers.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewWriter(ctx context.Context, config *types.WriterConfig) (*WriterPool, er
}

adapter := newfunc()
if err := utils.Unmarshal(config.AdapterConfig, adapter.GetConfigRef()); err != nil {
if err := utils.Unmarshal(config.WriterConfig, adapter.GetConfigRef()); err != nil {
return nil, err
}

Expand All @@ -45,7 +45,7 @@ func NewWriter(ctx context.Context, config *types.WriterConfig) (*WriterPool, er
return &WriterPool{
recordCount: atomic.Int64{},
threadCounter: atomic.Int64{},
config: config.AdapterConfig,
config: config.WriterConfig,
init: newfunc,
group: group,
groupCtx: ctx,
Expand Down
4 changes: 2 additions & 2 deletions types/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ const (

// TODO: Add validations
type WriterConfig struct {
Type AdapterType `json:"type"`
AdapterConfig any `json:"adapter"`
Type AdapterType `json:"type"`
WriterConfig any `json:"writer"`
}

0 comments on commit 402b11b

Please sign in to comment.