about summary refs log tree commit diff
path: root/litterbox.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-05-21 15:51:31 -0400
committerJune McEnroe <june@causal.agency>2022-05-21 15:55:53 -0400
commitc300d03c783af49075aabf641450baad552b8159 (patch)
tree7f13fdee8ef00aca60a8ab9e66be2b08f814d6b9 /litterbox.c
parentClose database before calling tls_close(3) (diff)
downloadlitterbox-c300d03c783af49075aabf641450baad552b8159.tar.gz
litterbox-c300d03c783af49075aabf641450baad552b8159.zip
Open database readonly from scoop
I originally changed it to RW so that PRAGMA optimize could run,
but since that relies on usage pattern information for that database
connection, I don't think it makes sense to run it in scoop anyway,
where only one query is run. Move it to litterbox only.
Diffstat (limited to 'litterbox.c')
-rw-r--r--litterbox.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/litterbox.c b/litterbox.c
index 24d5733..ccc3ecd 100644
--- a/litterbox.c
+++ b/litterbox.c
@@ -752,6 +752,7 @@ static void handle(struct Message *msg) {
 }
 
 static void atExit(void) {
+	dbExec(SQL(PRAGMA optimize;));
 	dbClose();
 	if (client) tls_close(client);
 }