|
|
@@ -115,6 +115,7 @@ function closeCircuitBreaker(url) {
|
|
|
* @param {Record<string, number>} opts.stats
|
|
|
* @param {Record<string, number>} opts.timings
|
|
|
* @param {Record<string, any>} opts.options
|
|
|
+ * @param {{path:string,method:string}} opts.metricsOpts
|
|
|
* @return {string | undefined}
|
|
|
*/
|
|
|
function notifyCLSICacheAboutBuild({
|
|
|
@@ -127,6 +128,7 @@ function notifyCLSICacheAboutBuild({
|
|
|
stats,
|
|
|
timings,
|
|
|
options,
|
|
|
+ metricsOpts,
|
|
|
}) {
|
|
|
if (!Settings.apis.clsiCache.enabled) return undefined
|
|
|
if (!OBJECT_ID_REGEX.test(projectId)) return undefined
|
|
|
@@ -192,26 +194,34 @@ function notifyCLSICacheAboutBuild({
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // PDF preview
|
|
|
- enqueue(
|
|
|
- outputFiles
|
|
|
- .filter(
|
|
|
- f =>
|
|
|
- f.path === 'output.pdf' ||
|
|
|
- f.path === 'output.log' ||
|
|
|
- f.path === 'output.synctex.gz'
|
|
|
- )
|
|
|
- .concat(
|
|
|
- outputFiles.filter(f => f.path.endsWith('.blg')).slice(0, MAX_BLG_FILES)
|
|
|
- )
|
|
|
- .map(f => {
|
|
|
- const lean = { path: f.path }
|
|
|
- if (f.path === 'output.pdf') {
|
|
|
- Object.assign(lean, _.pick(f, 'path', 'size', 'contentId', 'ranges'))
|
|
|
- }
|
|
|
- return lean
|
|
|
- })
|
|
|
- )
|
|
|
+ const isUserCompile = !metricsOpts.path
|
|
|
+ if (!(isUserCompile && compileGroup === 'standard')) {
|
|
|
+ // PDF preview, skip for free compiles
|
|
|
+ enqueue(
|
|
|
+ outputFiles
|
|
|
+ .filter(
|
|
|
+ f =>
|
|
|
+ f.path === 'output.pdf' ||
|
|
|
+ f.path === 'output.log' ||
|
|
|
+ f.path === 'output.synctex.gz'
|
|
|
+ )
|
|
|
+ .concat(
|
|
|
+ outputFiles
|
|
|
+ .filter(f => f.path.endsWith('.blg'))
|
|
|
+ .slice(0, MAX_BLG_FILES)
|
|
|
+ )
|
|
|
+ .map(f => {
|
|
|
+ const lean = { path: f.path }
|
|
|
+ if (f.path === 'output.pdf') {
|
|
|
+ Object.assign(
|
|
|
+ lean,
|
|
|
+ _.pick(f, 'path', 'size', 'contentId', 'ranges')
|
|
|
+ )
|
|
|
+ }
|
|
|
+ return lean
|
|
|
+ })
|
|
|
+ )
|
|
|
+ }
|
|
|
|
|
|
// Compile Cache
|
|
|
buildTarball({ projectId, userId, buildId, outputFiles })
|