Merge pull request #2798 from overleaf/spd-count-files

Add script to delete deleted-project data from filestore

GitOrigin-RevId: 9a2c5861edddf5ed26fc684257369fac4cf95475
This commit is contained in:
Simon Detheridge
2020-05-02 03:19:27 +00:00
committed by Copybot
parent f762fd1d16
commit bbe9f9a620
2 changed files with 52 additions and 2 deletions
@@ -3,6 +3,8 @@ const ProjectEntityHandler = require('../app/src/Features/Project/ProjectEntityH
const ProjectGetter = require('../app/src/Features/Project/ProjectGetter')
const Errors = require('../app/src/Features/Errors/Errors')
/* eslint-disable no-console */
async function countFiles() {
const rl = readline.createInterface({
input: process.stdin
@@ -29,10 +31,17 @@ async function countFiles() {
if (err instanceof Errors.NotFoundError) {
console.error(projectId, 'NOTFOUND')
} else {
throw err
console.log(projectId, 'ERROR', err.name, err.message)
}
}
}
}
countFiles().then(() => process.exit(0))
countFiles()
.then(() => {
process.exit(0)
})
.catch(err => {
console.log('Aiee, something went wrong!', err)
process.exit(1)
})