Merge pull request #3050 from overleaf/cmg-wfh-export

Logging updates to WFH export script

GitOrigin-RevId: ac6b9f92fcabe62a591d22c4efdb161da2758473
This commit is contained in:
Chrystal Maria Griffiths 2020-07-24 16:07:11 +01:00 committed by Copybot
parent a4f4617b03
commit 064ecda24f

View file

@ -7,8 +7,14 @@ db.subscriptions.aggregate(
{ $unwind: '$member_ids' },
{ $group: { _id: null, memberIds: { $addToSet: '$member_ids' } } },
function(err, results) {
if (err || !results.length) {
throw err
if (err) {
console.error(err)
process.exit(1)
}
if (!results.length) {
console.error('No users found')
process.exit(1)
}
const userIds = results[0].memberIds
@ -31,7 +37,8 @@ db.subscriptions.aggregate(
},
function(err) {
if (err) {
throw err
console.error(err)
process.exit(1)
}
process.exit(0)