We need a limit on the number of PostgreSQL connections

This commit is contained in:
Jakob Borg 2015-11-09 15:11:21 +01:00
parent f83ae630c1
commit 4a36cca703
1 changed files with 3 additions and 0 deletions

View File

@ -15,6 +15,9 @@ func init() {
func postgresSetup(db *sql.DB) error {
var err error
db.SetMaxIdleConns(4)
db.SetMaxOpenConns(8)
_, err = db.Exec(`CREATE TABLE IF NOT EXISTS Devices (
DeviceID CHAR(63) NOT NULL PRIMARY KEY,
Seen TIMESTAMP NOT NULL