mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 13:53:40 -05:00
fix performance of update removal
This commit is contained in:
parent
616c673ead
commit
ebbe728ec1
2 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ module.exports = RedisManager =
|
|||
multi = rclient.multi()
|
||||
# Delete all the updates which have been applied (exact match)
|
||||
for update in docUpdates or []
|
||||
multi.lrem Keys.uncompressedHistoryOps({doc_id}), 0, update
|
||||
multi.lrem Keys.uncompressedHistoryOps({doc_id}), 1, update
|
||||
multi.exec (error, results) ->
|
||||
return callback(error) if error?
|
||||
# It's ok to delete the doc_id from the set here. Even though the list
|
||||
|
|
|
@ -56,12 +56,12 @@ describe "RedisManager", ->
|
|||
|
||||
it "should delete the first update from redis", ->
|
||||
@rclient.lrem
|
||||
.calledWith("UncompressedHistoryOps:#{@doc_id}", 0, @jsonUpdates[0])
|
||||
.calledWith("UncompressedHistoryOps:#{@doc_id}", 1, @jsonUpdates[0])
|
||||
.should.equal true
|
||||
|
||||
it "should delete the second update from redis", ->
|
||||
@rclient.lrem
|
||||
.calledWith("UncompressedHistoryOps:#{@doc_id}", 0, @jsonUpdates[1])
|
||||
.calledWith("UncompressedHistoryOps:#{@doc_id}", 1, @jsonUpdates[1])
|
||||
.should.equal true
|
||||
|
||||
it "should delete the doc from the set of docs with history ops", ->
|
||||
|
|
Loading…
Reference in a new issue