diff options
author | 2025-01-14 18:30:55 +0000 | |
---|---|---|
committer | 2025-01-14 18:30:55 +0000 | |
commit | 81b66ad7e324dda72abc293433ecdaf4cf55c3a6 (patch) | |
tree | 7c2e1133ee2e5c6111d17be4937368f58115afe4 /vendor/github.com/ncruces/go-sqlite3/conn.go | |
parent | bump uptrace/bun dependencies from 1.2.6 to 1.2.8 (#3645) (diff) | |
download | gotosocial-81b66ad7e324dda72abc293433ecdaf4cf55c3a6.tar.xz |
update ncruces/go-sqlite3 v0.21.3 -> v0.22.0, gruf/go-ffmpreg v0.6.4 -> v0.6.5 (#3646)
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/conn.go')
-rw-r--r-- | vendor/github.com/ncruces/go-sqlite3/conn.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/conn.go b/vendor/github.com/ncruces/go-sqlite3/conn.go index d1ce30556..862d43061 100644 --- a/vendor/github.com/ncruces/go-sqlite3/conn.go +++ b/vendor/github.com/ncruces/go-sqlite3/conn.go @@ -6,6 +6,7 @@ import ( "math" "math/rand" "net/url" + "runtime" "strings" "time" @@ -67,7 +68,7 @@ func OpenFlags(filename string, flags OpenFlag) (*Conn, error) { return newConn(context.Background(), filename, flags) } -type connKey struct{} +type connKey = util.ConnKey func newConn(ctx context.Context, filename string, flags OpenFlag) (res *Conn, _ error) { err := ctx.Err() @@ -375,8 +376,13 @@ func (c *Conn) checkInterrupt(handle uint32) { } func progressCallback(ctx context.Context, mod api.Module, _ uint32) (interrupt uint32) { - if c, ok := ctx.Value(connKey{}).(*Conn); ok && c.interrupt.Err() != nil { - interrupt = 1 + if c, ok := ctx.Value(connKey{}).(*Conn); ok { + if c.interrupt.Done() != nil { + runtime.Gosched() + } + if c.interrupt.Err() != nil { + interrupt = 1 + } } return interrupt } |