remove new_project_history and use project_history instead

This commit is contained in:
Brian Gough 2020-04-21 14:43:48 +01:00
parent 8e210fe441
commit af93193d6e
3 changed files with 1 additions and 15 deletions

View file

@ -1,7 +1,6 @@
Settings = require('settings-sharelatex')
projectHistoryKeys = Settings.redis?.project_history?.key_schema
#rclient = require("redis-sharelatex").createClient(Settings.redis.project_history)
rclient = require("./RedisMigrationManager").createClient(Settings.redis.project_history, Settings.redis.new_project_history)
rclient = require("redis-sharelatex").createClient(Settings.redis.project_history)
logger = require('logger-sharelatex')
metrics = require('./Metrics')

View file

@ -37,23 +37,12 @@ module.exports =
docsWithHistoryOps: ({project_id}) -> "DocsWithHistoryOps:{#{project_id}}"
project_history:
port: process.env["HISTORY_REDIS_PORT"] or process.env["REDIS_PORT"] or "6379"
host: process.env["HISTORY_REDIS_HOST"] or process.env["REDIS_HOST"] or "localhost"
password: process.env["HISTORY_REDIS_PASSWORD"] or process.env["REDIS_PASSWORD"] or ""
maxRetriesPerRequest: parseInt(process.env['REDIS_MAX_RETRIES_PER_REQUEST'] or "20")
key_schema:
projectHistoryOps: ({project_id}) -> "ProjectHistory:Ops:{#{project_id}}"
projectHistoryFirstOpTimestamp: ({project_id}) -> "ProjectHistory:FirstOpTimestamp:{#{project_id}}"
new_project_history:
port: process.env["NEW_HISTORY_REDIS_PORT"] or "6379"
host: process.env["NEW_HISTORY_REDIS_HOST"]
password: process.env["NEW_HISTORY_REDIS_PASSWORD"] or ""
key_schema:
projectHistoryOps: ({project_id}) -> "ProjectHistory:Ops:{#{project_id}}"
projectHistoryFirstOpTimestamp: ({project_id}) -> "ProjectHistory:FirstOpTimestamp:{#{project_id}}"
projectHistoryMigrationKey: ({project_id}) -> "ProjectHistory:MigrationKey:{#{project_id}}"
migration_phase: process.env["PROJECT_HISTORY_MIGRATION_PHASE"] or "prepare"
redisOptions:
keepAlive: 100

View file

@ -24,8 +24,6 @@ describe "ProjectHistoryRedisManager", ->
}
"redis-sharelatex":
createClient: () => @rclient
"./RedisMigrationManager":
createClient: () => @rclient
"logger-sharelatex":
log:->
"./Metrics": @metrics = { summary: sinon.stub()}