overleaf/services/document-updater/scripts/flush_all.js
Andrew Rumble 71187a51ba Merge pull request #18289 from overleaf/ac-ar-eslint-return-await
Add ESLint rule @typescript-eslint/return-await to backend services

GitOrigin-RevId: 75e3e32597827fcc852e69d479515fc72e8f45e4
2024-05-27 10:22:49 +00:00

28 lines
603 B
JavaScript

const ProjectFlusher = require('../app/js/ProjectFlusher')
async function main() {
console.log('Flushing all projects')
return await new Promise((resolve, reject) => {
const options = {
limit: 100000,
concurrency: 5,
}
ProjectFlusher.flushAllProjects(options, err => {
if (err) {
reject(err)
} else {
resolve()
}
})
})
}
main()
.then(() => {
console.log('Done flushing all projects')
process.exit(0)
})
.catch(error => {
console.error('There was an error flushing all projects', { error })
process.exit(1)
})