Merge pull request #7767 from overleaf/em-relax-unarchive-docs

Allow concurrent doc unarchive operations

GitOrigin-RevId: 7edd1bd764125a0dc8e4a5fec643558a56e20f30
This commit is contained in:
Eric Mc Sween
2022-04-27 08:04:33 +00:00
committed by Copybot
parent e1b07cd40a
commit f282b5cb17
3 changed files with 9 additions and 12 deletions
+5 -4
View File
@@ -249,12 +249,13 @@ function archiveDoc(req, res, next) {
function unArchiveAllDocs(req, res, next) {
const { project_id: projectId } = req.params
logger.log({ projectId }, 'unarchiving all docs')
DocArchive.unArchiveAllDocs(projectId, function (error) {
if (error) {
if (error instanceof Errors.DocRevValueError) {
DocArchive.unArchiveAllDocs(projectId, function (err) {
if (err) {
if (err instanceof Errors.DocRevValueError) {
logger.warn({ err }, 'Failed to unarchive doc')
return res.sendStatus(409)
}
return next(error)
return next(err)
}
res.sendStatus(200)
})