From 3337f4c92dfc74b821d492b8b6dc4be126554c83 Mon Sep 17 00:00:00 2001 From: Simon J Mudd Date: Wed, 28 Jan 2015 08:36:26 +0100 Subject: [PATCH] Limit the pool size to avoid issues if existing connections get stuck --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index 0197e83..facfa65 100644 --- a/main.go +++ b/main.go @@ -59,6 +59,9 @@ func connect_by_defaults_file( defaults_file string ) *sql.DB { log.Fatal(err) } + // deliberately limit the pool size to 5 to avoid "problems" if any queries hang. + dbh.SetMaxOpenConns(5) // hard-coded value! + return dbh } -- 2.7.4