mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: use mongodb@6
This commit is contained in:
17 files changed
+64
-80
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user