Browse Source

avoid project history queues building up with deferred flush

Brian Gough 7 năm trước cách đây
mục cha
commit
d82b180b76

+ 1 - 1
services/document-updater/app/coffee/DeleteQueueManager.coffee

@@ -38,7 +38,7 @@ module.exports = DeleteQueueManager =
                     logger.debug {project_id, timestamps, flushTimestamp}, "found newer timestamp, will skip delete"
                     logger.debug {project_id, timestamps, flushTimestamp}, "found newer timestamp, will skip delete"
                     return cb()
                     return cb()
                 logger.log {project_id, flushTimestamp}, "flushing queued project"
                 logger.log {project_id, flushTimestamp}, "flushing queued project"
-                ProjectManager.flushAndDeleteProjectWithLocks project_id, {skip_history_flush: true}, (err) ->
+                ProjectManager.flushAndDeleteProjectWithLocks project_id, {skip_history_flush: false}, (err) ->
                     if err?
                     if err?
                         logger.err {project_id, err}, "error flushing queued project"
                         logger.err {project_id, err}, "error flushing queued project"
                     metrics.inc "queued-delete-completed"
                     metrics.inc "queued-delete-completed"

+ 2 - 2
services/document-updater/test/acceptance/coffee/DeletingAProjectTests.coffee

@@ -169,6 +169,6 @@ describe "Deleting a project", ->
 			for doc in @docs
 			for doc in @docs
 				MockTrackChangesApi.flushDoc.calledWith(doc.id).should.equal true
 				MockTrackChangesApi.flushDoc.calledWith(doc.id).should.equal true
 
 
-		it "should not flush to project history", ->
-			MockProjectHistoryApi.flushProject.called.should.equal false
+		it "should flush to project history", ->
+			MockProjectHistoryApi.flushProject.called.should.equal true