Problem: condition is unnecessarily complex

Solution: simplify condition
This commit is contained in:
Peter Stuifzand 2021-11-20 21:34:46 +01:00
parent 7a9777b416
commit ec8b2805f5
Signed by: peter
GPG Key ID: 374322D56E5209E8

View File

@ -136,10 +136,7 @@ func shouldRetryWithNewUID(err error, try int) bool {
if e, ok := err.(*pq.Error); ok { if e, ok := err.(*pq.Error); ok {
if e.Code == "23505" && e.Constraint == "channels_uid_key" { if e.Code == "23505" && e.Constraint == "channels_uid_key" {
if try > 5 { return try <= 5
return false
}
return true
} }
} }
return false return false