Skip to content

Commit 6a087ba

Browse files
committed
feat: allow changing requests timeout (database-lab#243)
1 parent 0c3b440 commit 6a087ba

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

config/config.example.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ channelMapping:
4848
url: "https://dblab.domain.com"
4949
# Secret token used to communicate with Database Lab API
5050
token: "secret_token"
51+
# Allow changing requests timeout
52+
# requestTimeout: 60s
5153

5254
# Available communication types ("webui", "slack", "slackrtm", etc.)
5355
communicationTypes:

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ require (
2020
github.com/sethvargo/go-password v0.2.0
2121
github.com/slack-go/slack v0.6.4
2222
github.com/stretchr/testify v1.7.0
23-
gitlab.com/postgres-ai/database-lab/v2 v2.2.1-0.20210309062306-91ccbafe4a96
23+
gitlab.com/postgres-ai/database-lab/v2 v2.2.1-0.20210416085316-cd4052615cf1
2424
gopkg.in/yaml.v2 v2.3.0
2525
gotest.tools/v3 v3.0.3 // indirect
2626
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
216216
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
217217
github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
218218
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
219-
gitlab.com/postgres-ai/database-lab/v2 v2.2.1-0.20210309062306-91ccbafe4a96 h1:1I8eA7Ku8RDkZmrYj6Dqu7xexfA9+CxAJBU1cczBN+E=
220-
gitlab.com/postgres-ai/database-lab/v2 v2.2.1-0.20210309062306-91ccbafe4a96/go.mod h1:t7THW1grFX1bG6I/b/RfjHADpc7ohyBk7VVbXnczoQQ=
219+
gitlab.com/postgres-ai/database-lab/v2 v2.2.1-0.20210416085316-cd4052615cf1 h1:WA9+2SXIGpQvk9LfFbAnhnXm21exwgp1kp9RNM46y1g=
220+
gitlab.com/postgres-ai/database-lab/v2 v2.2.1-0.20210416085316-cd4052615cf1/go.mod h1:t7THW1grFX1bG6I/b/RfjHADpc7ohyBk7VVbXnczoQQ=
221221
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
222222
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
223223
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=

pkg/bot/bot.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ func (a *App) initDBLabInstances() error {
109109
dbLabClient, err := dblabapi.NewClient(dblabapi.Options{
110110
Host: dbLab.URL,
111111
VerificationToken: dbLab.Token,
112+
RequestTimeout: dbLab.RequestTimeout,
112113
})
113114

114115
if err != nil {

pkg/config/config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ type ChannelMapping struct {
4545

4646
// DBLabInstance contains Database Lab config.
4747
type DBLabInstance struct {
48-
URL string
49-
Token string
48+
URL string
49+
Token string
50+
RequestTimeout time.Duration
5051
}
5152

5253
// Workspace defines a connection space.

0 commit comments

Comments
 (0)