mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 03:23:10 +00:00
fix acceptance tests to work with redis cluster
This commit is contained in:
parent
3b5a07d530
commit
0966f694da
1 changed files with 5 additions and 4 deletions
|
@ -1,9 +1,10 @@
|
|||
async = require 'async'
|
||||
zlib = require 'zlib'
|
||||
request = require "request"
|
||||
rclient = require("redis").createClient() # Only works locally for now
|
||||
{db, ObjectId} = require "../../../../app/js/mongojs"
|
||||
Settings = require "settings-sharelatex"
|
||||
rclient = require("redis-sharelatex").createClient(Settings.redis.history) # Only works locally for now
|
||||
Keys = Settings.redis.history.key_schema
|
||||
{db, ObjectId} = require "../../../../app/js/mongojs"
|
||||
|
||||
module.exports = TrackChangesClient =
|
||||
flushAndGetCompressedUpdates: (project_id, doc_id, callback = (error, updates) ->) ->
|
||||
|
@ -49,9 +50,9 @@ module.exports = TrackChangesClient =
|
|||
}, callback
|
||||
|
||||
pushRawUpdates: (project_id, doc_id, updates, callback = (error) ->) ->
|
||||
rclient.sadd "DocsWithHistoryOps:#{project_id}", doc_id, (error) ->
|
||||
rclient.sadd Keys.docsWithHistoryOps({project_id}), doc_id, (error) ->
|
||||
return callback(error) if error?
|
||||
rclient.rpush "UncompressedHistoryOps:#{doc_id}", (JSON.stringify(u) for u in updates)..., callback
|
||||
rclient.rpush Keys.uncompressedHistoryOps({doc_id}), (JSON.stringify(u) for u in updates)..., callback
|
||||
|
||||
getDiff: (project_id, doc_id, from, to, callback = (error, diff) ->) ->
|
||||
request.get {
|
||||
|
|
Loading…
Reference in a new issue