mirror of
https://github.com/netbirdio/dex.git
synced 2026-05-22 18:43:53 -07:00
postgres: improve readability of error check
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@ var (
|
||||
|
||||
err = tx.Commit()
|
||||
if err != nil {
|
||||
if pqErr, ok := err.(*pq.Error); ok && pqErr.Code == "40001" {
|
||||
if pqErr, ok := err.(*pq.Error); ok && pqErr.Code.Name() == "serialization_failure" {
|
||||
// serialization error; retry
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user