mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-06 01:21:24 +02:00
Minor improvements
* Set minimum number of pool instances to 2 * Improve logging of sync reasons * Improve logging of a new pool role
This commit is contained in:
@@ -14,4 +14,5 @@ const (
|
||||
ConnPoolContainer = 0
|
||||
ConnPoolMaxDBConnections = 60
|
||||
ConnPoolMaxClientConnections = 10000
|
||||
ConnPoolMinInstances = 2
|
||||
)
|
||||
|
||||
+12
-9
@@ -149,22 +149,25 @@ func CoalesceInt32(val, defaultVal *int32) *int32 {
|
||||
return val
|
||||
}
|
||||
|
||||
// Test if any of the values is nil
|
||||
func testNil(values ...*int32) bool {
|
||||
for _, v := range values {
|
||||
if v == nil {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// Return maximum of two integers provided via pointers. If one value is not
|
||||
// defined, return the other one. If both are not defined, result is also
|
||||
// undefined, caller needs to check for that.
|
||||
func MaxInt32(a, b *int32) *int32 {
|
||||
if a == nil && b == nil {
|
||||
if testNil(a, b) {
|
||||
return nil
|
||||
}
|
||||
|
||||
if a == nil {
|
||||
return b
|
||||
}
|
||||
|
||||
if b == nil {
|
||||
return a
|
||||
}
|
||||
|
||||
if *a > *b {
|
||||
return a
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user