2022-06-08 10:07:55 -04:00
|
|
|
// Run all the mongo queries on secondaries
|
|
|
|
process.env.MONGO_CONNECTION_STRING =
|
|
|
|
process.env.READ_ONLY_MONGO_CONNECTION_STRING
|
|
|
|
const SAMLEmailBatchCheck = require('../modules/overleaf-integration/app/src/SAML/SAMLEmailBatchCheck')
|
|
|
|
|
2022-06-16 09:17:18 -04:00
|
|
|
const startInstitutionId = parseInt(process.argv[2])
|
2022-06-08 10:07:55 -04:00
|
|
|
const emitDetailedData = process.argv.includes('--detailed-data')
|
|
|
|
|
|
|
|
SAMLEmailBatchCheck.promises
|
2022-06-16 09:17:18 -04:00
|
|
|
.checkEmails(startInstitutionId, emitDetailedData)
|
2022-06-08 10:07:55 -04:00
|
|
|
.then(result => {
|
|
|
|
console.table(result)
|
|
|
|
process.exit()
|
|
|
|
})
|
|
|
|
.catch(err => {
|
|
|
|
console.error(err)
|
|
|
|
process.exit(1)
|
|
|
|
})
|