diff --git a/services/clsi/app/js/CLSICacheHandler.js b/services/clsi/app/js/CLSICacheHandler.js index 73137d23c3..b9415ae3ec 100644 --- a/services/clsi/app/js/CLSICacheHandler.js +++ b/services/clsi/app/js/CLSICacheHandler.js @@ -41,7 +41,6 @@ function getShard(projectId) { * @param {string} editorId * @param {[{path: string}]} outputFiles * @param {string} compileGroup - * @param {boolean} clsiCacheSharded * @param {Record} options * @return {string | undefined} */ @@ -52,17 +51,11 @@ function notifyCLSICacheAboutBuild({ editorId, outputFiles, compileGroup, - clsiCacheSharded, options, }) { if (!Settings.apis.clsiCache.enabled) return undefined if (!OBJECT_ID_REGEX.test(projectId)) return undefined - let { url, shard } = getShard(projectId) - if (!clsiCacheSharded) { - // Client is not aware of sharding yet. - url = Settings.apis.clsiCache.url - shard = 'cache' - } + const { url, shard } = getShard(projectId) /** * @param {[{path: string}]} files diff --git a/services/clsi/app/js/CompileController.js b/services/clsi/app/js/CompileController.js index 4c411a54cf..7329c14342 100644 --- a/services/clsi/app/js/CompileController.js +++ b/services/clsi/app/js/CompileController.js @@ -125,7 +125,6 @@ function compile(req, res, next) { editorId: request.editorId, outputFiles, compileGroup: request.compileGroup, - clsiCacheSharded: request.clsiCacheSharded, options: { compiler: request.compiler, draft: request.draft, diff --git a/services/clsi/app/js/RequestParser.js b/services/clsi/app/js/RequestParser.js index f65d6940c8..4e9d722921 100644 --- a/services/clsi/app/js/RequestParser.js +++ b/services/clsi/app/js/RequestParser.js @@ -90,14 +90,6 @@ function parse(body, callback) { type: 'boolean', } ) - response.clsiCacheSharded = _parseAttribute( - 'clsiCacheSharded', - compile.options.clsiCacheSharded, - { - default: false, - type: 'boolean', - } - ) response.check = _parseAttribute('check', compile.options.check, { type: 'string', }) diff --git a/services/clsi/config/settings.defaults.js b/services/clsi/config/settings.defaults.js index 7472334d80..35783eb5b0 100644 --- a/services/clsi/config/settings.defaults.js +++ b/services/clsi/config/settings.defaults.js @@ -60,16 +60,8 @@ module.exports = { }`, }, clsiCache: { - enabled: !!(process.env.CLSI_CACHE_SHARDS || process.env.CLSI_CACHE_HOST), - url: `http://${process.env.CLSI_CACHE_HOST}:3044`, - shards: process.env.CLSI_CACHE_SHARDS - ? JSON.parse(process.env.CLSI_CACHE_SHARDS) - : [ - { - url: `http://${process.env.CLSI_CACHE_HOST}:3044`, - shard: 'cache', - }, - ], + enabled: !!process.env.CLSI_CACHE_SHARDS, + shards: JSON.parse(process.env.CLSI_CACHE_SHARDS || '[]'), }, }, diff --git a/services/web/app/src/Features/Compile/ClsiManager.js b/services/web/app/src/Features/Compile/ClsiManager.js index 011ba60759..6f11297248 100644 --- a/services/web/app/src/Features/Compile/ClsiManager.js +++ b/services/web/app/src/Features/Compile/ClsiManager.js @@ -781,7 +781,6 @@ function _finaliseRequest(projectId, options, project, docs, files) { imageName: project.imageName, draft: Boolean(options.draft), stopOnFirstError: Boolean(options.stopOnFirstError), - clsiCacheSharded: Boolean(options.clsiCacheSharded), check: options.check, syncType: options.syncType, syncState: options.syncState, diff --git a/services/web/app/src/Features/Compile/CompileController.js b/services/web/app/src/Features/Compile/CompileController.js index 25f8190374..8b190402ff 100644 --- a/services/web/app/src/Features/Compile/CompileController.js +++ b/services/web/app/src/Features/Compile/CompileController.js @@ -128,14 +128,12 @@ const _CompileController = { const isAutoCompile = !!req.query.auto_compile const fileLineErrors = !!req.query.file_line_errors const stopOnFirstError = !!req.body.stopOnFirstError - const clsiCacheSharded = !!req.body.clsiCacheSharded const userId = SessionManager.getLoggedInUserId(req.session) const options = { isAutoCompile, fileLineErrors, stopOnFirstError, editorId: req.body.editorId, - clsiCacheSharded, } if (req.body.rootDoc_id) { diff --git a/services/web/frontend/js/features/pdf-preview/util/compiler.js b/services/web/frontend/js/features/pdf-preview/util/compiler.js index cd052cb5a9..d938cb3893 100644 --- a/services/web/frontend/js/features/pdf-preview/util/compiler.js +++ b/services/web/frontend/js/features/pdf-preview/util/compiler.js @@ -110,7 +110,6 @@ export default class DocumentCompiler { incrementalCompilesEnabled: !this.error, stopOnFirstError: options.stopOnFirstError, editorId: EDITOR_SESSION_ID, - clsiCacheSharded: true, } const data = await postJSON( diff --git a/services/web/test/unit/src/Compile/CompileControllerTests.js b/services/web/test/unit/src/Compile/CompileControllerTests.js index df7276131c..25af7926b1 100644 --- a/services/web/test/unit/src/Compile/CompileControllerTests.js +++ b/services/web/test/unit/src/Compile/CompileControllerTests.js @@ -251,7 +251,6 @@ describe('CompileController', function () { fileLineErrors: false, stopOnFirstError: false, editorId: undefined, - clsiCacheSharded: false, } ) }) @@ -294,7 +293,6 @@ describe('CompileController', function () { fileLineErrors: false, stopOnFirstError: false, editorId: undefined, - clsiCacheSharded: false, } ) }) @@ -319,7 +317,6 @@ describe('CompileController', function () { fileLineErrors: false, stopOnFirstError: false, editorId: undefined, - clsiCacheSharded: false, } ) }) @@ -343,7 +340,6 @@ describe('CompileController', function () { fileLineErrors: false, stopOnFirstError: false, editorId: 'the-editor-id', - clsiCacheSharded: false, } ) })