Merge pull request #27518 from overleaf/tm-revert-scriptrunner-ensured-secondary

Remove ScriptRunner usage in institution user checks and SSO ID migration scripts

GitOrigin-RevId: 69bf575f879516e8daeb068f6911856c9d6f226c
This commit is contained in:
Liangjun Song
2025-07-30 17:05:07 +01:00
committed by Copybot
parent 092c8aaf32
commit 4d0f14898d
3 changed files with 5 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
import InstitutionsManager from '../app/src/Features/Institutions/InstitutionsManager.js'
import { ensureRunningOnMongoSecondaryWithTimeout } from './helpers/env_variable_helper.mjs'
import { scriptRunner } from './lib/ScriptRunner.mjs'
// ScriptRunner can not be used when using this assertion
ensureRunningOnMongoSecondaryWithTimeout(300000)
const institutionId = parseInt(process.argv[2])
@@ -19,7 +19,7 @@ async function main() {
}
try {
await scriptRunner(main)
await main()
} catch (error) {
console.error(error)
process.exit(1)

View File

@@ -1,6 +1,7 @@
import SAMLEmailBatchCheck from '../modules/saas-authentication/app/src/SAML/SAMLEmailBatchCheck.mjs'
import { ensureRunningOnMongoSecondaryWithTimeout } from './helpers/env_variable_helper.mjs'
// ScriptRunner can not be used when using this assertion
ensureRunningOnMongoSecondaryWithTimeout(300000)
const startInstitutionId = parseInt(process.argv[2])

View File

@@ -1,7 +1,7 @@
import SAMLUserIdMigrationHandler from '../modules/saas-authentication/app/src/SAML/SAMLUserIdMigrationHandler.mjs'
import { ensureRunningOnMongoSecondaryWithTimeout } from './helpers/env_variable_helper.mjs'
import { scriptRunner } from './lib/ScriptRunner.mjs'
// ScriptRunner can not be used when using this assertion
ensureRunningOnMongoSecondaryWithTimeout(300000)
const institutionId = parseInt(process.argv[2])
@@ -11,7 +11,7 @@ const emitUsers = process.argv.includes('--emit-users')
console.log('Checking SSO user ID migration for institution:', institutionId)
try {
await scriptRunner(main)
await main()
} catch (error) {
console.error(error)
process.exit(1)