Skip to content

Commit

Permalink
don't use *sync.Mutex when not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
czeslavo committed Jan 7, 2025
1 parent a912d99 commit 2d33eeb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions internal/dataplane/sendconfig/dbmode.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type UpdateStrategyDBMode struct {
isKonnect bool
logger logr.Logger
resourceErrors []ResourceError
resourceErrorLock *sync.Mutex
resourceErrorLock sync.Mutex
}

// UpdateStrategyDBModeOpt is a functional option for UpdateStrategyDBMode.
Expand All @@ -57,13 +57,11 @@ func NewUpdateStrategyDBMode(
opts ...UpdateStrategyDBModeOpt,
) *UpdateStrategyDBMode {
s := &UpdateStrategyDBMode{
client: client,
dumpConfig: dumpConfig,
version: version,
concurrency: concurrency,
logger: logger,
resourceErrors: []ResourceError{},
resourceErrorLock: &sync.Mutex{},
client: client,
dumpConfig: dumpConfig,
version: version,
concurrency: concurrency,
logger: logger,
}
for _, opt := range opts {
opt(s)
Expand Down

0 comments on commit 2d33eeb

Please sign in to comment.