Revert "only flush to track-changes when ops are queued"

This reverts commit 0baa8f989481ca263fa71e90af21f13b29c29504.
This commit is contained in:
Brian Gough 2015-12-01 15:48:49 +00:00
parent 64f5d5526e
commit 13e22e1802
3 changed files with 1 additions and 14 deletions

View file

@ -91,7 +91,7 @@ module.exports = DocumentManager =
logger.log project_id: project_id, doc_id: doc_id, version: version, "flushing doc"
PersistenceManager.setDoc project_id, doc_id, lines, version, (error) ->
return callback(error) if error?
TrackChangesManager.flushDocChangesIfNeeded project_id, doc_id, (error) ->
TrackChangesManager.flushDocChanges project_id, doc_id, (error) ->
return callback(error) if error?
callback null

View file

@ -171,9 +171,6 @@ module.exports = RedisManager =
[length, _] = results
callback(error, length)
getUncompressedHistoryOpLength: (doc_id, callback = (error, length) ->) ->
rclient.llen keys.uncompressedHistoryOp(doc_id: doc_id), callback
getDocOpsLength: (doc_id, callback = (error, length) ->) ->
rclient.llen keys.docOps(doc_id: doc_id), callback

View file

@ -5,16 +5,6 @@ RedisManager = require "./RedisManager"
crypto = require("crypto")
module.exports = TrackChangesManager =
flushDocChangesIfNeeded: (project_id, doc_id, callback = (error) ->) ->
RedisManager.getUncompressedHistoryOpLength doc_id, (error, length) ->
return callback(error) if error?
if length > 0
# only make request to track changes if there are queued ops
TrackChangesManager.flushDocChanges project_id, doc_id, callback
else
callback()
flushDocChanges: (project_id, doc_id, callback = (error) ->) ->
if !settings.apis?.trackchanges?
logger.warn doc_id: doc_id, "track changes API is not configured, so not flushing"