mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-21 07:59:47 +02:00
fix: db row close error be ignored (#2578)
This commit is contained in:
+10
-2
@@ -205,7 +205,11 @@ func (c *Cluster) readPgUsersFromDatabase(userNames []string) (users spec.PgUser
|
|||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
if err2 := rows.Close(); err2 != nil {
|
if err2 := rows.Close(); err2 != nil {
|
||||||
err = fmt.Errorf("error when closing query cursor: %v", err2)
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error when closing query cursor: %v, previous error: %v", err2, err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error when closing query cursor: %v", err2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -252,7 +256,11 @@ func findUsersFromRotation(rotatedUsers []string, db *sql.DB) (map[string]string
|
|||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
if err2 := rows.Close(); err2 != nil {
|
if err2 := rows.Close(); err2 != nil {
|
||||||
err = fmt.Errorf("error when closing query cursor: %v", err2)
|
if err != nil {
|
||||||
|
err = fmt.Errorf("error when closing query cursor: %v, previous error: %v", err2, err)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("error when closing query cursor: %v", err2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user