mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 12:39:33 -05:00
a7517eefcb
[web] populate db with collections on import, ahead of waitForDb() call GitOrigin-RevId: 7eb4cd61c2052187acd9947d7060f54d9822d314
25 lines
761 B
JavaScript
25 lines
761 B
JavaScript
import InstitutionsManager from '../app/src/Features/Institutions/InstitutionsManager.js'
|
|
import { ensureRunningOnMongoSecondaryWithTimeout } from './helpers/env_variable_helper.mjs'
|
|
|
|
ensureRunningOnMongoSecondaryWithTimeout(300000)
|
|
|
|
const institutionId = parseInt(process.argv[2])
|
|
if (isNaN(institutionId)) throw new Error('No institution id')
|
|
console.log('Checking users of institution', institutionId)
|
|
const emitNonProUserIds = process.argv.includes('--emit-non-pro-user-ids')
|
|
|
|
async function main() {
|
|
const usersSummary = await InstitutionsManager.promises.checkInstitutionUsers(
|
|
institutionId,
|
|
emitNonProUserIds
|
|
)
|
|
console.log(usersSummary)
|
|
process.exit()
|
|
}
|
|
|
|
try {
|
|
await main()
|
|
} catch (error) {
|
|
console.error(error)
|
|
process.exit(1)
|
|
}
|