mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-09 11:15:35 +02:00
removing inner goroutine in cluster.Switchover (#1876)
* removing inner goroutine in cluster.Switchover and resolve race between processPodEvent and unregisterPodSubscriber * unlock mutex after handling event, now with non-blocking default case
This commit is contained in:
+9
-1
@@ -324,12 +324,20 @@ func testNil(values ...*int32) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Convert int to IntOrString type
|
||||
// ToIntStr converts int to IntOrString type
|
||||
func ToIntStr(val int) *intstr.IntOrString {
|
||||
b := intstr.FromInt(val)
|
||||
return &b
|
||||
}
|
||||
|
||||
// Bool2Int converts bool to int
|
||||
func Bool2Int(flag bool) int {
|
||||
if flag {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Get int from IntOrString and return max int if string
|
||||
func IntFromIntStr(intOrStr intstr.IntOrString) int {
|
||||
if intOrStr.Type == 1 {
|
||||
|
||||
Reference in New Issue
Block a user