diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-05-03 00:15:59 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-05-03 00:16:02 -0700 |
| commit | 94a35f25f35e992eab10beae124e76fcec21c3a1 (patch) | |
| tree | c561442b9ec454cbfceed3b3a2f8b0b29c45f63a | |
| parent | 63c4884b16f8762174038f163e96800aa609faca (diff) | |
| download | seaweedfs-94a35f25f35e992eab10beae124e76fcec21c3a1.tar.xz seaweedfs-94a35f25f35e992eab10beae124e76fcec21c3a1.zip | |
simple refactoring
| -rw-r--r-- | weed/filer/postgres_store/postgres_native.go | 7 |
1 files changed, 1 insertions, 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) |
