Skip to content

Commit ad883e1

Browse files
committed
Close connection in optimize(), fixes #4
1 parent 211ef24 commit ad883e1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

graphite-ch-optimizer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ func optimize() error {
278278
// Getting connection pool and check it for work
279279
cfg.ClickHouse.connect, _ = sql.Open("clickhouse", cfg.ClickHouse.ServerDsn)
280280
connect := cfg.ClickHouse.connect
281+
defer connect.Close()
281282
err := connect.Ping()
282283
if checkErr(err) != nil {
283284
logrus.Fatalf("Ping ClickHouse server failed: %v", err)

0 commit comments

Comments
 (0)