Merge pull request #3762 from thelounge/xpaw/sqlite-serialize

Change sqlite parallelize to serialize when loading messages
This commit is contained in:
Pavel Djundik 2020-02-27 14:02:29 +02:00 committed by GitHub
commit d99d56fe81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,7 +159,7 @@ class MessageStorage {
const limit = Helper.config.maxHistory < 0 ? 100000 : Helper.config.maxHistory;
return new Promise((resolve, reject) => {
this.database.parallelize(() =>
this.database.serialize(() =>
this.database.all(
"SELECT msg, type, time FROM messages WHERE network = ? AND channel = ? ORDER BY time DESC LIMIT ?",
[network.uuid, channel.name.toLowerCase(), limit],