Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
fix: slug caching
Browse files Browse the repository at this point in the history
  • Loading branch information
froid1911 committed Jun 7, 2024
1 parent b8b6135 commit 1134dc6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 1134dc6

Please sign in to comment.