mirror of
https://github.com/docmost/docmost.git
synced 2026-08-20 23:41:37 +10:00
wip
This commit is contained in:
@@ -34,7 +34,7 @@ export class UnfurlService {
|
||||
userId: string,
|
||||
workspaceId: string,
|
||||
): Promise<UnfurlResult | null> {
|
||||
const cacheKey = this.buildCacheKey(workspaceId, url);
|
||||
const cacheKey = this.buildCacheKey(workspaceId, userId, url);
|
||||
const cached = await this.redis.get(cacheKey);
|
||||
if (cached) {
|
||||
return JSON.parse(cached);
|
||||
@@ -127,12 +127,12 @@ export class UnfurlService {
|
||||
return null;
|
||||
}
|
||||
|
||||
private buildCacheKey(workspaceId: string, url: string): string {
|
||||
private buildCacheKey(workspaceId: string, userId: string, url: string): string {
|
||||
const hash = crypto
|
||||
.createHash('sha256')
|
||||
.update(url)
|
||||
.digest('hex')
|
||||
.slice(0, 16);
|
||||
return `${UNFURL_CACHE_PREFIX}${workspaceId}:${hash}`;
|
||||
return `${UNFURL_CACHE_PREFIX}${workspaceId}:${userId}:${hash}`;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
Submodule apps/server/src/ee updated: 010a833e1a...73f6bad794
Reference in New Issue
Block a user