Problem: condition is unnecessarily complex
Solution: simplify condition
This commit is contained in:
parent
7a9777b416
commit
ec8b2805f5
|
@ -136,10 +136,7 @@ func shouldRetryWithNewUID(err error, try int) bool {
|
|||
|
||||
if e, ok := err.(*pq.Error); ok {
|
||||
if e.Code == "23505" && e.Constraint == "channels_uid_key" {
|
||||
if try > 5 {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return try <= 5
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
|
Loading…
Reference in New Issue
Block a user