core: optimize database operation

This commit is contained in:
undefined committed 2023-01-30 11:40:19 +08:00
1 parent 7a164483ba
commit 0726dba492
3 files changed
+18 -2

No files matched your search

+1 -1
View File
@@ -130,7 +130,7 @@ export async function apply(ctx: Context) {
while (true) {
// eslint-disable-next-line no-await-in-loop
const res = await collEvent.findOneAndUpdate(
{ ack: { $nin: [id] } },
{ expire: { $gt: new Date() }, ack: { $nin: [id] } },
{ $push: { ack: id } },
);
// eslint-disable-next-line no-await-in-loop