mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 15:49:01 +02:00
Delete only the updates that were processed, not a full batch
This commit is contained in:
@@ -39,7 +39,7 @@ module.exports = HistoryManager =
|
||||
HistoryManager.compressAndSaveRawUpdates doc_id, rawUpdates, (error) ->
|
||||
return callback(error) if error?
|
||||
logger.log doc_id: doc_id, "compressed and saved doc updates"
|
||||
RedisManager.deleteOldestRawUpdates doc_id, HistoryManager.REDIS_READ_BATCH_SIZE, (error) ->
|
||||
RedisManager.deleteOldestRawUpdates doc_id, length, (error) ->
|
||||
return callback(error) if error?
|
||||
if length == HistoryManager.REDIS_READ_BATCH_SIZE
|
||||
# There might be more updates
|
||||
|
||||
@@ -132,7 +132,7 @@ describe "HistoryManager", ->
|
||||
|
||||
it "should delete the batch of uncompressed updates that was just processed", ->
|
||||
@RedisManager.deleteOldestRawUpdates
|
||||
.calledWith(@doc_id, @HistoryManager.REDIS_READ_BATCH_SIZE)
|
||||
.calledWith(@doc_id, @updates.length)
|
||||
.should.equal true
|
||||
|
||||
it "should call the callback", ->
|
||||
|
||||
Reference in New Issue
Block a user