aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-12-29 12:32:44 +0100
committerPřemysl Eric Janouch <p@janouch.name>2024-12-29 12:32:44 +0100
commitca462ac0056cfe434acc8b8faf50a439ce3f8c91 (patch)
treee50a31ef98446a0fcfd9ab01bb0f269011a9a41c
parente895beadb7ce5309d6ffeec1090de5e72e8e34db (diff)
downloadgallery-ca462ac0056cfe434acc8b8faf50a439ce3f8c91.tar.gz
gallery-ca462ac0056cfe434acc8b8faf50a439ce3f8c91.tar.xz
gallery-ca462ac0056cfe434acc8b8faf50a439ce3f8c91.zip
Remember to optimize the database
-rw-r--r--main.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.go b/main.go
index d9d20c4..53306d7 100644
--- a/main.go
+++ b/main.go
@@ -2700,6 +2700,9 @@ func main() {
// Note that the database object has a closing finalizer,
// we just additionally print any errors coming from there.
if db != nil {
+ if _, err := db.Exec(`PRAGMA optimize`); err != nil {
+ log.Println(err)
+ }
if err := db.Close(); err != nil {
log.Println(err)
}