[web] avoid trying to fetch synctex.gz from clsi-cache in free projects (#25445)
* [web] avoid trying to fetch synctex.gz from clsi-cache in free projects * [clsi] parse boolean query parameter GitOrigin-RevId: 99c98aac8147a626b704e9a888b7fc660cc5ab17
This commit is contained in:
@@ -191,7 +191,8 @@ function clearCache(req, res, next) {
|
||||
}
|
||||
|
||||
function syncFromCode(req, res, next) {
|
||||
const { file, editorId, buildId, compileFromClsiCache } = req.query
|
||||
const { file, editorId, buildId } = req.query
|
||||
const compileFromClsiCache = req.query.compileFromClsiCache === 'true'
|
||||
const line = parseInt(req.query.line, 10)
|
||||
const column = parseInt(req.query.column, 10)
|
||||
const { imageName } = req.query
|
||||
@@ -220,7 +221,8 @@ function syncFromPdf(req, res, next) {
|
||||
const page = parseInt(req.query.page, 10)
|
||||
const h = parseFloat(req.query.h)
|
||||
const v = parseFloat(req.query.v)
|
||||
const { imageName, editorId, buildId, compileFromClsiCache } = req.query
|
||||
const { imageName, editorId, buildId } = req.query
|
||||
const compileFromClsiCache = req.query.compileFromClsiCache === 'true'
|
||||
const projectId = req.params.project_id
|
||||
const userId = req.params.user_id
|
||||
CompileManager.syncFromPdf(
|
||||
|
||||
@@ -553,6 +553,12 @@ const _CompileController = {
|
||||
async _proxyToClsi(projectId, action, url, qs, req, res) {
|
||||
const limits =
|
||||
await CompileManager.promises.getProjectCompileLimits(projectId)
|
||||
if (
|
||||
qs?.compileFromClsiCache &&
|
||||
!['alpha', 'priority'].includes(limits.compileGroup)
|
||||
) {
|
||||
qs.compileFromClsiCache = false
|
||||
}
|
||||
return CompileController._proxyToClsiWithLimits(
|
||||
projectId,
|
||||
action,
|
||||
|
||||
Reference in New Issue
Block a user