From e001fd7d1ca3e27045f1d5a242d7c95556295e25 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Wed, 9 Aug 2023 21:05:15 +0800 Subject: [PATCH] incrementalVacuum for sqlite only --- server/jobs/incremental-vacuum.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/jobs/incremental-vacuum.js b/server/jobs/incremental-vacuum.js index a4523246..3a04b12c 100644 --- a/server/jobs/incremental-vacuum.js +++ b/server/jobs/incremental-vacuum.js @@ -1,5 +1,6 @@ const { R } = require("redbean-node"); const { log } = require("../../src/util"); +const Database = require("../database"); /** * Run incremental_vacuum and checkpoint the WAL. @@ -8,6 +9,11 @@ const { log } = require("../../src/util"); const incrementalVacuum = async () => { try { + if (Database.dbConfig.type !== "sqlite") { + log.debug("incrementalVacuum", "Skipping incremental_vacuum, not using SQLite."); + return; + } + log.debug("incrementalVacuum", "Running incremental_vacuum and wal_checkpoint(PASSIVE)..."); await R.exec("PRAGMA incremental_vacuum(200)"); await R.exec("PRAGMA wal_checkpoint(PASSIVE)");