fix(cron): don't process group tasks during user cron
This commit is contained in:
@@ -74,19 +74,10 @@ async function cronAsync (req, res) {
|
||||
}
|
||||
|
||||
const tasks = await Tasks.Task.find({
|
||||
$and: [
|
||||
{
|
||||
$or: [
|
||||
{ userId: user._id },
|
||||
{ userId: { $exists: false }, 'group.assignedUsers': user._id },
|
||||
],
|
||||
},
|
||||
{
|
||||
$or: [ // Exclude completed todos
|
||||
{ type: 'todo', completed: false },
|
||||
{ type: { $in: ['habit', 'daily', 'reward'] } },
|
||||
],
|
||||
},
|
||||
userId: user._id,
|
||||
$or: [ // Exclude completed todos
|
||||
{ type: 'todo', completed: false },
|
||||
{ type: { $in: ['habit', 'daily'] } },
|
||||
],
|
||||
}).exec();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user