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
```
pull/2829/head
drewblin 4 years ago committed by GitHub
parent b5af931f88
commit 063251248c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -140,6 +140,10 @@ module.exports = {
await conn.query(`set application_name = 'Wiki.js'`) await conn.query(`set application_name = 'Wiki.js'`)
done() done()
break break
case 'mysql':
await conn.promise().query(`set autocommit = 1`)
done()
break
default: default:
done() done()
break break

Loading…
Cancel
Save