[clsi] avoid server error when clearing cache while compiling (#32349)

* [clsi] avoid server error when clearing cache while compiling

* [clsi] tweak API around releasing locks

Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>

---------

Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>
GitOrigin-RevId: d3f171467d3bc26941758dd333f30049b37a05c8
This commit is contained in:
Jakob Ackermann
2026-03-20 13:56:30 +01:00
committed by Copybot
parent 1c6d4b7be3
commit 07397bbdde
7 changed files with 130 additions and 13 deletions

View File

@@ -144,10 +144,15 @@ function _writeLogOutput(projectId, directory, output, callback) {
})
}
function isRunning(projectId) {
const id = `${projectId}`
return ProcessTable[id] != null
}
function killLatex(projectId, callback) {
const id = `${projectId}`
logger.debug({ id }, 'killing running compile')
if (ProcessTable[id] == null) {
if (!isRunning(projectId)) {
logger.warn({ id }, 'no such project to kill')
callback(null)
} else {
@@ -208,6 +213,7 @@ function _buildLatexCommand(mainFile, opts = {}) {
}
export default {
isRunning,
runLatex,
killLatex,
promises: {