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
```
This commit is contained in:
drewblin 2020-12-13 21:57:20 +02:00 committed by GitHub
parent b5af931f88
commit 063251248c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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