From c68413bd5338beb52e455e9bd22ac3683c2128f4 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Thu, 14 Dec 2023 17:22:25 +0000 Subject: [PATCH] Optimize interrupts. --- conn.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/conn.go b/conn.go index 2e339ac..8c3d382 100644 --- a/conn.go +++ b/conn.go @@ -103,7 +103,7 @@ func (c *Conn) openDB(filename string, flags OpenFlag) (uint32, error) { return 0, err } } - + c.call("sqlite3_progress_handler_go", uint64(handle), 100) return handle, nil } @@ -252,12 +252,10 @@ func (c *Conn) SetInterrupt(ctx context.Context) (old context.Context) { c.interrupt = ctx // Remove the handler if the context can't be canceled. if ctx == nil || ctx.Done() == nil { - c.call("sqlite3_progress_handler_go", uint64(c.handle), 0) return old } c.pending.Step() - c.call("sqlite3_progress_handler_go", uint64(c.handle), 100) return old }