mirror of
https://github.com/gtsteffaniak/filebrowser.git
synced 2026-11-26 00:19:41 -05:00
Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: FandacqkaCorp <david@davidyloreto.com> Co-authored-by: FandacqkaCorp <275647464+FandacqkaCorp@users.noreply.github.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
22 lines
553 B
Go
22 lines
553 B
Go
//go:build cgosql
|
|
// +build cgosql
|
|
|
|
package sqlitebusy
|
|
|
|
import (
|
|
"errors"
|
|
|
|
sqlite3 "github.com/mattn/go-sqlite3"
|
|
)
|
|
|
|
// isBusyOrLocked reports whether err is a SQLITE_BUSY or SQLITE_LOCKED error
|
|
// from the CGO (mattn/go-sqlite3) driver. Error.Code is already the primary
|
|
// result code; extended codes are reported separately in Error.ExtendedCode.
|
|
func isBusyOrLocked(err error) bool {
|
|
var sqliteErr sqlite3.Error
|
|
if !errors.As(err, &sqliteErr) {
|
|
return false
|
|
}
|
|
return sqliteErr.Code == sqlite3.ErrBusy || sqliteErr.Code == sqlite3.ErrLocked
|
|
}
|