summaryrefslogtreecommitdiff
path: root/vendor/github.com/ncruces/go-sqlite3/vfs/os_linux.go
diff options
context:
space:
mode:
authorLibravatar Daenney <daenney@users.noreply.github.com>2024-09-14 16:36:25 +0200
committerLibravatar GitHub <noreply@github.com>2024-09-14 16:36:25 +0200
commit4fa0d412023ffdefc4ba63eecccd4b74e712ff7d (patch)
tree02ad2eb48c195eb52e22e6152909f45c7cae58f6 /vendor/github.com/ncruces/go-sqlite3/vfs/os_linux.go
parent[feature/frontend] Add dark version of brutalist theme (#3294) (diff)
downloadgotosocial-4fa0d412023ffdefc4ba63eecccd4b74e712ff7d.tar.xz
[chore] Update go-sqlite3 to 0.18.3 (#3295)
* [chore] Update go-sqlite3 to 0.18.3 * [chore] Fix getting the sqlite3.Conn
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/vfs/os_linux.go')
-rw-r--r--vendor/github.com/ncruces/go-sqlite3/vfs/os_linux.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/vfs/os_linux.go b/vendor/github.com/ncruces/go-sqlite3/vfs/os_linux.go
index 7bb78c0af..e163e804d 100644
--- a/vendor/github.com/ncruces/go-sqlite3/vfs/os_linux.go
+++ b/vendor/github.com/ncruces/go-sqlite3/vfs/os_linux.go
@@ -53,10 +53,11 @@ func osLock(file *os.File, typ int16, start, len int64, timeout time.Duration, d
if errno, _ := err.(unix.Errno); errno != unix.EAGAIN {
break
}
- if timeout < time.Since(before) {
+ if time.Since(before) > timeout {
break
}
- time.Sleep(time.Duration(rand.Int63n(int64(time.Millisecond))))
+ const sleepIncrement = 1024*1024 - 1 // power of two, ~1ms
+ time.Sleep(time.Duration(rand.Int63() & sleepIncrement))
}
}
return osLockErrorCode(err, def)