core: use mongodb@6

This commit is contained in:
undefined committed 2025-03-21 06:28:56 +08:00
1 parent 0bd15caee6
commit b6f1a9c627
17 files changed
+64 -80

No files matched your search

+6 -6
View File
@@ -29,13 +29,13 @@ export class WorkerService extends Service {
subType: { $in: Object.keys(this.handlers) },
};
const res = await this.coll.findOneAndDelete(q);
if (res.value) {
this.ctx.logger.debug('%o', res.value);
if (res.value.interval) {
const executeAfter = moment(res.value.executeAfter).add(...res.value.interval).toDate();
await this.coll.insertOne({ ...res.value, executeAfter });
if (res) {
this.ctx.logger.debug('%o', res);
if (res.interval) {
const executeAfter = moment(res.executeAfter).add(...res.interval).toDate();
await this.coll.insertOne({ ...res, executeAfter });
}
return res.value;
return res;
}
return null;
}