Skip to content

Commit

Permalink
fixed invalid db for audits
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Nov 21, 2019
1 parent 7059f00 commit 2681ceb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/tasks/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ let run = async (taskData, options) => {
}

let mailboxes = new Map(
(await db.database
.collection('mailboxes')
.find({ user: taskData.user })
.toArray()).map(mailboxData => [mailboxData._id.toString(), mailboxData])
(
await db.database
.collection('mailboxes')
.find({ user: taskData.user })
.toArray()
).map(mailboxData => [mailboxData._id.toString(), mailboxData])
);

let processMessage = async messageData => {
Expand Down Expand Up @@ -61,7 +63,7 @@ let run = async (taskData, options) => {
let status = 'imported'; //expect to complete successfully

let processMessages = async collection => {
let cursor = await db.users.collection(collection).find(query, {
let cursor = await db.database.collection(collection).find(query, {
projection: {
_id: true,
user: true,
Expand Down

0 comments on commit 2681ceb

Please sign in to comment.