From 1134dc6c1384648f6af5c871d0e51e6acb4e63fb Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 7 Jun 2024 12:06:32 +0200 Subject: [PATCH] fix: slug caching --- src/server/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/index.ts b/src/server/index.ts index d07f15b1..52a58461 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -468,6 +468,7 @@ export class DocumentDriveServer extends BaseDocumentDriveServer { }); await this.storage.createDrive(id, document); + const storageDrive = await this.getDrive(id) await this._initializeDrive(id); return document; @@ -541,7 +542,7 @@ export class DocumentDriveServer extends BaseDocumentDriveServer { async getDriveBySlug(slug: string, options?: GetDocumentOptions) { try { - const document = await this.cache.getDocument('drives', slug); + const document = await this.cache.getDocument('drives-slug', slug); if (document && isDocumentDrive(document)) { return document; } @@ -557,7 +558,7 @@ export class DocumentDriveServer extends BaseDocumentDriveServer { ); } else { this.cache - .setDocument('drives', slug, document) + .setDocument('drives-slug', slug, document) .catch(logger.error); return document; }