Skip to content

Commit

Permalink
show log when retrying mysql errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Oct 2, 2020
1 parent 3a4a8b5 commit 0f51ffa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"time"

"github.com/cenkalti/dalga/v3/internal/clock"
"github.com/cenkalti/dalga/v3/internal/log"
"github.com/cenkalti/dalga/v3/internal/retry"
my "github.com/go-mysql/errors"
"github.com/go-sql-driver/mysql"
Expand Down Expand Up @@ -455,6 +456,7 @@ func withRetries(retryCount int, fn func() error) (err error) {
return nil
}
if dur := mysqlRetryInterval(err); dur > 0 {
log.Println("mysql error:", err.Error(), "sleeping", dur.String(), "before retry")
time.Sleep(dur)
continue
}
Expand Down

0 comments on commit 0f51ffa

Please sign in to comment.