From 063251248c7a378fe6a8e6e69f47bf55fab88293 Mon Sep 17 00:00:00 2001 From: drewblin Date: Sun, 13 Dec 2020 21:57:20 +0200 Subject: [PATCH] fix: set autocommit for mysql (#2638) If in server config mysql has autocommit = 0, then wikijs fails with locks like this: ``` 2020-10-30T12:56:51.725Z [JOB] error: Rebuilding page tree: [ FAILED ] 2020-10-30T12:56:51.726Z [JOB] error: truncate `pageTree` - Lock wait timeout exceeded; try restarting transaction ``` --- server/core/db.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/core/db.js b/server/core/db.js index 6ae657a8..f1ac88b3 100644 --- a/server/core/db.js +++ b/server/core/db.js @@ -140,6 +140,10 @@ module.exports = { await conn.query(`set application_name = 'Wiki.js'`) done() break + case 'mysql': + await conn.promise().query(`set autocommit = 1`) + done() + break default: done() break