Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e4aa8e

Browse files
committed
fixes
1 parent 58288de commit 3e4aa8e

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

cli/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,9 +718,9 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
718718
}
719719

720720
if options.DeploymentValues.Prometheus.Enable && options.DeploymentValues.Prometheus.CollectDBMetrics {
721-
options.Database = dbmetrics.NewQueryMetrics(options.Database, options.PrometheusRegistry)
721+
options.Database = dbmetrics.NewQueryMetrics(options.Database, options.Logger, options.PrometheusRegistry)
722722
} else {
723-
options.Database = dbmetrics.NewDBMetrics(options.Database, options.PrometheusRegistry)
723+
options.Database = dbmetrics.NewDBMetrics(options.Database, options.Logger, options.PrometheusRegistry)
724724
}
725725

726726
var deploymentID string

coderd/database/db_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestSerializedRetry(t *testing.T) {
2727
db := database.New(sqlDB)
2828

2929
called := 0
30-
txOpts := &sql.TxOptions{Isolation: sql.LevelSerializable}
30+
txOpts := &database.TxOptions{Isolation: sql.LevelSerializable}
3131
err := db.InTx(func(tx database.Store) error {
3232
// Test nested error
3333
return tx.InTx(func(tx database.Store) error {

coderd/database/tx_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestReadModifyUpdate_OK(t *testing.T) {
1919
mDB := dbmock.NewMockStore(gomock.NewController(t))
2020

2121
mDB.EXPECT().
22-
InTx(gomock.Any(), &sql.TxOptions{Isolation: sql.LevelRepeatableRead}).
22+
InTx(gomock.Any(), &database.TxOptions{Isolation: sql.LevelRepeatableRead}).
2323
Times(1).
2424
Return(nil)
2525
err := database.ReadModifyUpdate(mDB, func(tx database.Store) error {
@@ -34,11 +34,11 @@ func TestReadModifyUpdate_RetryOK(t *testing.T) {
3434
mDB := dbmock.NewMockStore(gomock.NewController(t))
3535

3636
firstUpdate := mDB.EXPECT().
37-
InTx(gomock.Any(), &sql.TxOptions{Isolation: sql.LevelRepeatableRead}).
37+
InTx(gomock.Any(), &database.TxOptions{Isolation: sql.LevelRepeatableRead}).
3838
Times(1).
3939
Return(&pq.Error{Code: pq.ErrorCode("40001")})
4040
mDB.EXPECT().
41-
InTx(gomock.Any(), &sql.TxOptions{Isolation: sql.LevelRepeatableRead}).
41+
InTx(gomock.Any(), &database.TxOptions{Isolation: sql.LevelRepeatableRead}).
4242
After(firstUpdate).
4343
Times(1).
4444
Return(nil)
@@ -55,7 +55,7 @@ func TestReadModifyUpdate_HardError(t *testing.T) {
5555
mDB := dbmock.NewMockStore(gomock.NewController(t))
5656

5757
mDB.EXPECT().
58-
InTx(gomock.Any(), &sql.TxOptions{Isolation: sql.LevelRepeatableRead}).
58+
InTx(gomock.Any(), &database.TxOptions{Isolation: sql.LevelRepeatableRead}).
5959
Times(1).
6060
Return(xerrors.New("a bad thing happened"))
6161

@@ -71,7 +71,7 @@ func TestReadModifyUpdate_TooManyRetries(t *testing.T) {
7171
mDB := dbmock.NewMockStore(gomock.NewController(t))
7272

7373
mDB.EXPECT().
74-
InTx(gomock.Any(), &sql.TxOptions{Isolation: sql.LevelRepeatableRead}).
74+
InTx(gomock.Any(), &database.TxOptions{Isolation: sql.LevelRepeatableRead}).
7575
Times(5).
7676
Return(&pq.Error{Code: pq.ErrorCode("40001")})
7777
err := database.ReadModifyUpdate(mDB, func(tx database.Store) error {

docs/reference/cli/server.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enterprise/coderd/workspacequota.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (c *committer) CommitQuota(
104104
permit = true
105105
consumed = newConsumed
106106
return nil
107-
}, &sql.TxOptions{
107+
}, &database.TxOptions{
108108
Isolation: sql.LevelSerializable,
109109
})
110110
if err != nil {

enterprise/dbcrypt/cliutil.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func Rotate(ctx context.Context, log slog.Logger, sqlDB *sql.DB, ciphers []Ciphe
7373
}
7474
}
7575
return nil
76-
}, &sql.TxOptions{
76+
}, &database.TxOptions{
7777
Isolation: sql.LevelRepeatableRead,
7878
})
7979
if err != nil {
@@ -163,7 +163,7 @@ func Decrypt(ctx context.Context, log slog.Logger, sqlDB *sql.DB, ciphers []Ciph
163163
}
164164
}
165165
return nil
166-
}, &sql.TxOptions{
166+
}, &database.TxOptions{
167167
Isolation: sql.LevelRepeatableRead,
168168
})
169169
if err != nil {

0 commit comments

Comments
 (0)