mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Delete only the updates that were processed, not a full batch
This commit is contained in:
parent
d1e18d82aa
commit
76cdd5cf98
2 changed files with 2 additions and 2 deletions
|
@ -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", ->
|
||||
|
|
Loading…
Reference in a new issue