From 94a35f25f35e992eab10beae124e76fcec21c3a1 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 3 May 2018 00:15:59 -0700 Subject: [PATCH] simple refactoring --- weed/filer/postgres_store/postgres_native.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/weed/filer/postgres_store/postgres_native.go b/weed/filer/postgres_store/postgres_native.go index 47631b016..12b5015cf 100644 --- a/weed/filer/postgres_store/postgres_native.go +++ b/weed/filer/postgres_store/postgres_native.go @@ -94,17 +94,12 @@ func getDbConnection(conf PostgresConf) *sql.DB { panic(pingErr) } - var maxIdleConnections, maxOpenConnections int - + maxIdleConnections, maxOpenConnections := default_maxIdleConnections, default_maxOpenConnections if conf.MaxIdleConnections != 0 { maxIdleConnections = conf.MaxIdleConnections - } else { - maxIdleConnections = default_maxIdleConnections } if conf.MaxOpenConnections != 0 { maxOpenConnections = conf.MaxOpenConnections - } else { - maxOpenConnections = default_maxOpenConnections } _db_connection.SetMaxIdleConns(maxIdleConnections)