1
0
mirror of https://github.com/ddworken/hishtory.git synced 2025-03-30 10:37:16 +02:00

Check sqlite DB error messages with Contains to be slightly more lenient

This commit is contained in:
David Dworken 2023-09-14 12:32:50 -07:00
parent d753c3d4d7
commit 01d9924cc0
No known key found for this signature in database

View File

@ -490,7 +490,7 @@ func RetryingDbFunction(dbFunc func() error) error {
return nil
}
errMsg := err.Error()
if errMsg == "database is locked (5) (SQLITE_BUSY)" || errMsg == "database is locked (261)" {
if strings.Contains(errMsg, "database is locked (5) (SQLITE_BUSY)") || strings.Contains(errMsg, "database is locked (261)") {
time.Sleep(time.Duration(i*rand.Intn(100)) * time.Millisecond)
continue
}