diff --git a/lib/sdm.js b/lib/sdm.js index f16f88d..386a6cd 100644 --- a/lib/sdm.js +++ b/lib/sdm.js @@ -39,8 +39,9 @@ module.exports = class SDMAttachmentsService extends ( async checkRepositoryType(req) { const { repositoryId } = getConfigurations(); + let subdomain = cds.context.user?.tokenInfo?.getPayload()?.ext_attr?.zdn; //check if repository is versionable - let repotype = cache.get(repositoryId) + let repotype = cache.get(repositoryId+"_"+subdomain); let isVersioned; if (repotype == undefined) { const token = await getClientCredentialsToken(this.creds); diff --git a/lib/util/index.js b/lib/util/index.js index 4722483..ca9f8ba 100644 --- a/lib/util/index.js +++ b/lib/util/index.js @@ -70,9 +70,10 @@ function isRepositoryVersioned(repoInfo, repositoryId) { } function saveRepoToCache(repositoryId, type) { - const repoType = cache.get(repositoryId); + let subdomain = cds.context.user?.tokenInfo?.getPayload()?.ext_attr?.zdn; + const repoType = cache.get(repositoryId+"_"+subdomain); if (repoType === undefined) { - cache.set(repositoryId, type, 60 * 60 * 24 * 60); + cache.set((repositoryId+"_"+subdomain), type, 60 * 60 * 24 * 60); } }