Skip to content

Commit

Permalink
move more general case below
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Oct 2, 2020
1 parent 8ca8131 commit b062f0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,12 @@ func withRetries(retryCount int, fn func() error) (err error) {

func mysqlRetryInterval(err error) time.Duration {
if ok, myerr := my.Error(err); ok { // MySQL error
if my.CanRetry(myerr) {
return time.Second
}
if my.MySQLErrorCode(err) == 1213 { // deadlock
return time.Millisecond * 10
}
if my.CanRetry(myerr) {

This comment has been minimized.

Copy link
@tooolbox

tooolbox Oct 2, 2020

Contributor

Yeah, makes sense 👍

return time.Second
}
}
return 0
}

0 comments on commit b062f0d

Please sign in to comment.