[fix] Fix bug with useDirectStorageUrls=false when persistentStorage.storageFolderName differs from storage.storageFolderName

This commit is contained in:
Sergey Konovalov
2025-05-31 12:10:31 +03:00
parent fd4842605b
commit d4658ce600
3 changed files with 19 additions and 12 deletions

View File

@ -59,10 +59,10 @@ function getStoragePath(ctx, strPath, opt_specialDir) {
return opt_specialDir + '/' + tenantManager.getTenantPathPrefix(ctx) + strPath.replace(/\\/g, '/');
}
function getStorage(opt_specialDir) {
return opt_specialDir ? persistentStorage : cacheStorage;
return (opt_specialDir && opt_specialDir !== cfgCacheStorage.cacheFolderName) ? persistentStorage : cacheStorage;
}
function getStorageCfg(ctx, opt_specialDir) {
return opt_specialDir ? cfgPersistentStorage : cfgCacheStorage;
return (opt_specialDir && opt_specialDir !== cfgCacheStorage.cacheFolderName) ? cfgPersistentStorage : cfgCacheStorage;
}
function canCopyBetweenStorage(storageCfgSrc, storageCfgDst) {
return storageCfgSrc.name === storageCfgDst.name && storageCfgSrc.endpoint === storageCfgDst.endpoint;