mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
[web] fix preparing clsi-cache when cloning project (#31169)
* [web] fix preparing clsi-cache when cloning project * [monorepo] fix downloads from non-sharded clsi-cache * [web] gracefully handle missing imageName when creating template GitOrigin-RevId: 8647d1bb95edbedcd43cb6f9d9bc475f56e402c8
This commit is contained in:
@@ -241,7 +241,6 @@ async function prepareCacheSource(
|
||||
userId,
|
||||
{ sourceProjectId, templateVersionId, imageName, lastUpdated, shard, signal }
|
||||
) {
|
||||
imageName = Path.basename(imageName)
|
||||
const url = new URL(
|
||||
`/project/${projectId}/user/${userId}/import-from`,
|
||||
Settings.apis.clsiCache.instances.find(i => i.shard === shard).url
|
||||
|
||||
@@ -15,6 +15,7 @@ import crypto from 'node:crypto'
|
||||
import Errors from '../Errors/Errors.js'
|
||||
import { pipeline } from 'node:stream/promises'
|
||||
import ClsiCacheManager from '../Compile/ClsiCacheManager.mjs'
|
||||
import Path from 'node:path'
|
||||
|
||||
const { promises: ProjectRootDocManager } = ProjectRootDocManagerModule
|
||||
const { promises: ProjectOptionsHandler } = ProjectOptionsHandlerModule
|
||||
@@ -76,7 +77,7 @@ const TemplatesManager = {
|
||||
const prepareClsiCacheInBackground = ClsiCacheManager.prepareClsiCache(
|
||||
project._id,
|
||||
userId,
|
||||
{ templateVersionId, imageName }
|
||||
{ templateVersionId, imageName: imageName && Path.basename(imageName) }
|
||||
).catch(err => {
|
||||
logger.warn(
|
||||
{ err, templateVersionId, projectId: project._id },
|
||||
|
||||
Reference in New Issue
Block a user