mirror of
https://github.com/LBRYFoundation/reflector.go.git
synced 2025-08-23 17:27:25 +00:00
log timed-out query
This commit is contained in:
parent
2047fe6c05
commit
c3ab5dd2a5
1 changed files with 6 additions and 3 deletions
9
db/db.go
9
db/db.go
|
@ -419,9 +419,12 @@ func exec(e Executor, query string, args ...interface{}) error {
|
||||||
Retry:
|
Retry:
|
||||||
attempt++
|
attempt++
|
||||||
_, err = e.Exec(query, args...)
|
_, err = e.Exec(query, args...)
|
||||||
if e, ok := err.(*mysql.MySQLError); ok && attempt <= maxAttempts && e.Number == 1205 {
|
if e, ok := err.(*mysql.MySQLError); ok && e.Number == 1205 {
|
||||||
//Error 1205: Lock wait timeout exceeded; try restarting transaction
|
if attempt <= maxAttempts {
|
||||||
goto Retry
|
//Error 1205: Lock wait timeout exceeded; try restarting transaction
|
||||||
|
goto Retry
|
||||||
|
}
|
||||||
|
err = errors.Prefix("Timed out query "+query, err)
|
||||||
}
|
}
|
||||||
return errors.Err(err)
|
return errors.Err(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue