mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-26 05:00:06 +02:00

Update some scripts to use Script Runner GitOrigin-RevId: aaa11f94dcfd328c158bb02d1b9fb2adfb1bb146
32 lines
692 B
JavaScript
32 lines
692 B
JavaScript
import { db } from '../../app/src/infrastructure/mongodb.js'
|
|
import { batchedUpdate } from '@overleaf/mongo-utils/batchedUpdate.js'
|
|
import { scriptRunner } from '../lib/ScriptRunner.mjs'
|
|
|
|
async function main(trackProgress) {
|
|
// update all applicable user models
|
|
await batchedUpdate(
|
|
db.users,
|
|
{
|
|
'writefull.enabled': false,
|
|
},
|
|
{
|
|
$set: {
|
|
'aiErrorAssistant.enabled': false,
|
|
},
|
|
},
|
|
undefined,
|
|
undefined,
|
|
{ trackProgress }
|
|
)
|
|
console.log('completed syncing writefull state with error assist')
|
|
}
|
|
|
|
export default main
|
|
|
|
try {
|
|
await scriptRunner(main)
|
|
process.exit(0)
|
|
} catch (error) {
|
|
console.error({ error })
|
|
process.exit(1)
|
|
}
|