From 4415f77b182a9d87408676193dcba1610afc4953 Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Wed, 26 Aug 2020 09:41:27 +0100 Subject: [PATCH] Merge pull request #3140 from overleaf/ho-swallow-deactive-project-err if deactivateProject errors, continue the deactivateOldProjects jobs GitOrigin-RevId: b3c2584e0a042cb3c78e609314c320a9b657640c --- .../Features/InactiveData/InactiveProjectManager.js | 8 +++++++- .../src/InactiveData/InactiveProjectManagerTests.js | 12 ------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/services/web/app/src/Features/InactiveData/InactiveProjectManager.js b/services/web/app/src/Features/InactiveData/InactiveProjectManager.js index 2ea6f2a2a5..7fbc0f67ed 100644 --- a/services/web/app/src/Features/InactiveData/InactiveProjectManager.js +++ b/services/web/app/src/Features/InactiveData/InactiveProjectManager.js @@ -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 }, diff --git a/services/web/test/unit/src/InactiveData/InactiveProjectManagerTests.js b/services/web/test/unit/src/InactiveData/InactiveProjectManagerTests.js index eb7a389ab9..489b7847f9 100644 --- a/services/web/test/unit/src/InactiveData/InactiveProjectManagerTests.js +++ b/services/web/test/unit/src/InactiveData/InactiveProjectManagerTests.js @@ -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()