Skip to content

Commit 6911539

Browse files
committed
ReadTimeout => ReadTimeoutSeconds
1 parent c62be0e commit 6911539

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cmd/bootstrap/async_replication.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func bootstrapAsyncReplication(ctx context.Context) error {
8787
if err != nil {
8888
return errors.Wrap(err, "get read timeout")
8989
}
90-
params.ReadTimeout = readTimeout
90+
params.ReadTimeoutSeconds = readTimeout
9191

9292
db, err := database.NewDatabase(ctx, params)
9393
if err != nil {
@@ -219,7 +219,7 @@ func getTopology(ctx context.Context, fqdn string, peers sets.Set[string]) (stri
219219
if err != nil {
220220
return "", nil, errors.Wrap(err, "get read timeout")
221221
}
222-
params.ReadTimeout = readTimeout
222+
params.ReadTimeoutSeconds = readTimeout
223223

224224
db, err := database.NewDatabase(ctx, params)
225225
if err != nil {
@@ -285,7 +285,7 @@ func selectDonor(ctx context.Context, fqdn, primary string, replicas []string) (
285285
if err != nil {
286286
return "", errors.Wrap(err, "get read timeout")
287287
}
288-
params.ReadTimeout = readTimeout
288+
params.ReadTimeoutSeconds = readTimeout
289289

290290
db, err := database.NewDatabase(ctx, params)
291291
if err != nil {

cmd/db/db.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ type DBParams struct {
2929
Host string
3030
Port int32
3131

32-
ReadTimeout uint32 // in seconds
32+
ReadTimeoutSeconds uint32
3333
}
3434

3535
func (p *DBParams) setDefaults() {
3636
if p.Port == 0 {
3737
p.Port = defs.DefaultAdminPort
3838
}
3939

40-
if p.ReadTimeout == 0 {
41-
p.ReadTimeout = 10
40+
if p.ReadTimeoutSeconds == 0 {
41+
p.ReadTimeoutSeconds = 10
4242
}
4343
}
4444

@@ -55,7 +55,7 @@ func (p *DBParams) DSN() string {
5555
config.Params = map[string]string{
5656
"interpolateParams": "true",
5757
"timeout": "10s",
58-
"readTimeout": fmt.Sprintf("%ds", p.ReadTimeout),
58+
"readTimeout": fmt.Sprintf("%ds", p.ReadTimeoutSeconds),
5959
"writeTimeout": "10s",
6060
"tls": "preferred",
6161
}

0 commit comments

Comments
 (0)