Merge pull request #3140 from overleaf/ho-swallow-deactive-project-err

if deactivateProject errors, continue the deactivateOldProjects jobs

GitOrigin-RevId: b3c2584e0a042cb3c78e609314c320a9b657640c
This commit is contained in:
Simon Detheridge 2020-08-26 09:41:27 +01:00 committed by Copybot
parent b48b937f26
commit 4415f77b18
2 changed files with 7 additions and 13 deletions

View file

@ -74,7 +74,13 @@ module.exports = InactiveProjectManager = {
logger.err({ err }, 'could not get projects for deactivating')
}
const jobs = _.map(projects, project => cb =>
InactiveProjectManager.deactivateProject(project._id, cb)
InactiveProjectManager.deactivateProject(project._id, function(err) {
logger.err(
{ project_id: project._id, err: err },
'unable to deactivate project'
)
cb()
})
)
logger.log(
{ numberOfProjects: projects != null ? projects.length : undefined },

View file

@ -159,15 +159,3 @@ describe('InactiveProjectManager', function() {
})
})
})
// it "should not call markAsInactive if there was a problem archiving in track changes", (done)->
// @DocstoreManager.archiveProject.callsArgWith(1)
// @TrackChangesManager.archiveProject.callsArgWith(1, "errorrr")
// @ProjectUpdateHandler.markAsInactive.callsArgWith(1)
// @InactiveProjectManager.deactivateProject @project_id, (err)=>
// err.should.equal "errorrr"
// @DocstoreManager.archiveProject.calledWith(@project_id).should.equal true
// @ProjectUpdateHandler.markAsInactive.calledWith(@project_id).should.equal false
// done()