Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pkg/backend/dqlite/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ func NewDriver(ctx context.Context, config *DriverConfig) (*Driver, error) {
}

drv, err := sqlite.NewDriver(ctx, &sqlite.DriverConfig{
DB: config.DB,
LockWrites: true,
Retry: dqliteRetry,
DB: config.DB,
Retry: dqliteRetry,
})
if err != nil {
return nil, err
Expand Down
11 changes: 2 additions & 9 deletions pkg/backend/sqlite/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,8 @@ type Driver struct {
}

type DriverConfig struct {
DB database.Interface
LockWrites bool
Retry func(error) bool
DB database.Interface
Retry func(error) bool
}

func NewDriver(ctx context.Context, config *DriverConfig) (*Driver, error) {
Expand Down Expand Up @@ -451,12 +450,6 @@ func (d *Driver) execute(ctx context.Context, txName, query string, args ...inte
attribute.String("tx_name", txName),
)

if d.config.LockWrites {
d.mu.Lock()
defer d.mu.Unlock()
span.AddEvent("acquired write lock")
}

start := time.Now()
retryCount := 0
defer func() {
Expand Down
Loading