diff --git a/services/clsi/app/js/CLSICacheHandler.js b/services/clsi/app/js/CLSICacheHandler.js index 9ba2d6f499..dbe5127e1c 100644 --- a/services/clsi/app/js/CLSICacheHandler.js +++ b/services/clsi/app/js/CLSICacheHandler.js @@ -42,6 +42,8 @@ function getShard(projectId) { * @param {string} editorId * @param {[{path: string}]} outputFiles * @param {string} compileGroup + * @param {Record} stats + * @param {Record} timings * @param {Record} options * @return {string | undefined} */ @@ -52,6 +54,8 @@ function notifyCLSICacheAboutBuild({ editorId, outputFiles, compileGroup, + stats, + timings, options, }) { if (!Settings.apis.clsiCache.enabled) return undefined @@ -72,6 +76,8 @@ function notifyCLSICacheAboutBuild({ downloadHost: Settings.apis.clsi.downloadHost, clsiServerId: Settings.apis.clsi.clsiServerId, compileGroup, + stats, + timings, options, }) ) diff --git a/services/clsi/app/js/CompileController.js b/services/clsi/app/js/CompileController.js index 285354ad84..c5300c6ec3 100644 --- a/services/clsi/app/js/CompileController.js +++ b/services/clsi/app/js/CompileController.js @@ -125,6 +125,8 @@ function compile(req, res, next) { editorId: request.editorId, outputFiles, compileGroup: request.compileGroup, + stats, + timings, options: { compiler: request.compiler, draft: request.draft, diff --git a/services/clsi/app/js/CompileManager.js b/services/clsi/app/js/CompileManager.js index f0fd8514a2..44b5224417 100644 --- a/services/clsi/app/js/CompileManager.js +++ b/services/clsi/app/js/CompileManager.js @@ -561,6 +561,13 @@ async function _runSynctex(projectId, userId, command, opts) { let downloadedFromCache = false try { await _checkFileExists(directory, 'output.synctex.gz') + if (compileFromClsiCache) { + try { + await _checkFileExists(directory, 'output.log') + } catch (err) { + if (err instanceof Errors.NotFoundError) downloadedFromCache = true + } + } } catch (err) { if ( err instanceof Errors.NotFoundError && diff --git a/services/web/app/src/Features/Compile/ClsiCacheController.mjs b/services/web/app/src/Features/Compile/ClsiCacheController.mjs index 79b3aac827..57b5ca6eaf 100644 --- a/services/web/app/src/Features/Compile/ClsiCacheController.mjs +++ b/services/web/app/src/Features/Compile/ClsiCacheController.mjs @@ -123,6 +123,8 @@ async function getLatestBuildFromCache(req, res) { clsiServerId, clsiCacheShard, options, + stats, + timings, } = await ClsiCacheManager.getLatestCompileResult(projectId, userId) let { pdfCachingMinChunkSize, pdfDownloadDomain } = @@ -138,6 +140,8 @@ async function getLatestBuildFromCache(req, res) { pdfDownloadDomain, pdfCachingMinChunkSize, options, + stats, + timings, }) } catch (err) { if (err instanceof NotFoundError) { diff --git a/services/web/app/src/Features/Compile/ClsiCacheManager.js b/services/web/app/src/Features/Compile/ClsiCacheManager.js index d6594abf34..3722b0c0ec 100644 --- a/services/web/app/src/Features/Compile/ClsiCacheManager.js +++ b/services/web/app/src/Features/Compile/ClsiCacheManager.js @@ -107,7 +107,16 @@ async function tryGetLatestCompileResult(projectId, userId, signal) { const [, editorId, buildId] = metaLocation.match( /\/build\/([a-f0-9-]+?)-([a-f0-9]+-[a-f0-9]+)\// ) - const { ranges, contentId, clsiServerId, compileGroup, size, options } = meta + const { + ranges, + contentId, + clsiServerId, + compileGroup, + size, + options, + stats, + timings, + } = meta let baseURL = `/project/${projectId}` if (userId) { @@ -150,6 +159,8 @@ async function tryGetLatestCompileResult(projectId, userId, signal) { clsiServerId, clsiCacheShard, options, + stats, + timings, } }