From 8335f31d6ce758209268e2aa7f0073b65c8079e7 Mon Sep 17 00:00:00 2001 From: Tim Alby Date: Thu, 4 Jun 2020 10:37:43 +0200 Subject: [PATCH] fix linting --- services/track-changes/.eslintignore | 1 + services/track-changes/app.js | 15 +++++++++------ .../track-changes/config/settings.defaults.js | 16 ++++++++-------- 3 files changed, 18 insertions(+), 14 deletions(-) create mode 100644 services/track-changes/.eslintignore diff --git a/services/track-changes/.eslintignore b/services/track-changes/.eslintignore new file mode 100644 index 0000000000..c59a33a4df --- /dev/null +++ b/services/track-changes/.eslintignore @@ -0,0 +1 @@ +app/lib/diff_match_patch.js diff --git a/services/track-changes/app.js b/services/track-changes/app.js index 8d0890e988..df2db8a79a 100644 --- a/services/track-changes/app.js +++ b/services/track-changes/app.js @@ -42,7 +42,7 @@ const Path = require('path') Metrics.memory.monitor(logger) -const child_process = require('child_process') +const childProcess = require('child_process') const HttpController = require('./app/js/HttpController') const express = require('express') @@ -84,11 +84,14 @@ app.post('/pack', function (req, res, next) { return res.send('pack already running') } else { logger.log('running pack') - packWorker = child_process.fork(__dirname + '/app/js/PackWorker.js', [ - req.query.limit || 1000, - req.query.delay || 1000, - req.query.timeout || 30 * 60 * 1000 - ]) + packWorker = childProcess.fork( + Path.join(__dirname, '/app/js/PackWorker.js'), + [ + req.query.limit || 1000, + req.query.delay || 1000, + req.query.timeout || 30 * 60 * 1000 + ] + ) packWorker.on('exit', function (code, signal) { logger.log({ code, signal }, 'history auto pack exited') return (packWorker = null) diff --git a/services/track-changes/config/settings.defaults.js b/services/track-changes/config/settings.defaults.js index 2cee6df6af..426592ed26 100755 --- a/services/track-changes/config/settings.defaults.js +++ b/services/track-changes/config/settings.defaults.js @@ -40,11 +40,11 @@ module.exports = { port: process.env.REDIS_PORT || 6379, password: process.env.REDIS_PASSWORD || '', key_schema: { - historyLock({ doc_id }) { - return `HistoryLock:{${doc_id}}` + historyLock({ doc_id: docId }) { + return `HistoryLock:{${docId}}` }, - historyIndexLock({ project_id }) { - return `HistoryIndexLock:{${project_id}}` + historyIndexLock({ project_id: projectId }) { + return `HistoryIndexLock:{${projectId}}` } } }, @@ -53,11 +53,11 @@ module.exports = { port: process.env.REDIS_PORT || 6379, password: process.env.REDIS_PASSWORD || '', key_schema: { - uncompressedHistoryOps({ doc_id }) { - return `UncompressedHistoryOps:{${doc_id}}` + uncompressedHistoryOps({ doc_id: docId }) { + return `UncompressedHistoryOps:{${docId}}` }, - docsWithHistoryOps({ project_id }) { - return `DocsWithHistoryOps:{${project_id}}` + docsWithHistoryOps({ project_id: projectId }) { + return `DocsWithHistoryOps:{${projectId}}` } } }