Skip to content

Commit

Permalink
feat: add timeouts to clickhouse
Browse files Browse the repository at this point in the history
  • Loading branch information
iamKunalGupta committed May 20, 2024
1 parent f4f055c commit 4f0afac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions flow/connectors/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"net/url"
"strings"
"time"

"github.com/ClickHouse/clickhouse-go/v2"
_ "github.com/ClickHouse/clickhouse-go/v2/lib/driver"
Expand Down Expand Up @@ -184,6 +185,13 @@ func connect(ctx context.Context, config *protos.ClickhouseConfig) (*sql.DB, err
{Name: "peerdb"},
},
},
Settings: map[string]any{
"idle_timeout": 10000,
"connect_timeout": 10000,
"send_timeout": 10000,
"receive_timeout": 10000,
},
ReadTimeout: 10000 * time.Second,
})

if err := conn.PingContext(ctx); err != nil {
Expand Down

0 comments on commit 4f0afac

Please sign in to comment.