mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-10 17:52:25 +02:00
Serialize create
This commit is contained in:
parent
f948362a73
commit
33e9be387b
|
@ -202,16 +202,18 @@ class MessageStorage {
|
||||||
}
|
}
|
||||||
|
|
||||||
// This channel was not found, create it and "recursively" call getChannelId again
|
// This channel was not found, create it and "recursively" call getChannelId again
|
||||||
this.database.run(
|
this.database.serialize(() =>
|
||||||
"INSERT INTO channels (network, channel) VALUES (?, ?)",
|
this.database.run(
|
||||||
[network.uuid, channelName],
|
"INSERT INTO channels (network, channel) VALUES (?, ?)",
|
||||||
(err2) => {
|
[network.uuid, channelName],
|
||||||
if (err2) {
|
(err2) => {
|
||||||
return reject(err2);
|
if (err2) {
|
||||||
}
|
return reject(err2);
|
||||||
|
}
|
||||||
|
|
||||||
this.getChannelId(network, channel).then(resolve).catch(reject);
|
this.getChannelId(network, channel).then(resolve).catch(reject);
|
||||||
}
|
}
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue