fix:屏蔽检测生成新的任务逻辑

This commit is contained in:
xichaoyin 2024-01-10 14:52:41 +08:00
parent 4596fb537c
commit 0a296d739a

View File

@ -261,28 +261,28 @@ export class TaskFun {
delete _w["finish"];
}
let _tmp = await this.getUserTaksList(call.uid, _w);
// 没有未完成任务
// 检测是否有新加任务
if (_tmp.length == 0) {
let rectask = (await G.mongodb.collection('task').find(
{ uid: call.uid, type: _type }, { projection: { taskid: 1, _id: 0 } }
).toArray()).map(e => e.taskid);
// // 没有未完成任务 后续添加任务直接使用脚本刷任务
// // 检测是否有新加任务
// if (_tmp.length == 0) {
// let rectask = (await G.mongodb.collection('task').find(
// { uid: call.uid, type: _type }, { projection: { taskid: 1, _id: 0 } }
// ).toArray()).map(e => e.taskid);
for (let taskid of rectask) {
let conf = G.gc.task[_type][taskid];
// 配置不存在
// 没有后续任务
// 后续任务已完成
if (!conf || !conf.followtask || rectask.includes(conf.followtask)) {
continue
}
// for (let taskid of rectask) {
// let conf = G.gc.task[_type][taskid];
// // 配置不存在
// // 没有后续任务
// // 后续任务已完成
// if (!conf || !conf.followtask || rectask.includes(conf.followtask)) {
// continue
// }
// 生成后续任务
await this.setTaskInfo(call, conf.followtask, { type: _type });
break;
}
_tmp = await this.getUserTaksList(call.uid, _w);
}
// // 生成后续任务
// await this.setTaskInfo(call, conf.followtask, { type: _type });
// break;
// }
// _tmp = await this.getUserTaksList(call.uid, _w);
// }
_r[_type] = _tmp;
}
return _r;