diff --git a/src/core/storage/LocalSessionConfigRepository.ts b/src/core/storage/LocalSessionConfigRepository.ts index 327cffb8..ac2c1b3c 100644 --- a/src/core/storage/LocalSessionConfigRepository.ts +++ b/src/core/storage/LocalSessionConfigRepository.ts @@ -52,8 +52,7 @@ export class LocalSessionConfigRepository extends ISessionConfigRepository { } private getFilePath(sessionName): string { - const folder = this.store.getSessionDirectory(sessionName); - return path.join(folder, this.FILENAME); + return this.store.getFilePath(sessionName, this.FILENAME); } async delete(sessionName: string): Promise { diff --git a/src/core/storage/LocalStore.ts b/src/core/storage/LocalStore.ts index eed83f19..3ac751c8 100644 --- a/src/core/storage/LocalStore.ts +++ b/src/core/storage/LocalStore.ts @@ -17,4 +17,9 @@ export abstract class LocalStore extends DataStore { * Get the directory where the session data is stored */ abstract getSessionDirectory(name: string): string; + + /** + * Get the file path for a session + */ + abstract getFilePath(session: string, file: string): string; } diff --git a/src/core/storage/LocalStoreCore.ts b/src/core/storage/LocalStoreCore.ts index 00b5c8fa..b292e8fe 100644 --- a/src/core/storage/LocalStoreCore.ts +++ b/src/core/storage/LocalStoreCore.ts @@ -45,6 +45,10 @@ export class LocalStoreCore extends LocalStore { return this.getDirectoryPath(name); } + getFilePath(session: string, file: string): string { + return path.join(this.getSessionDirectory(session), file); + } + protected getDirectoryPath(name: string): string { const suffix = crypto.createHash('md5').update(name).digest('hex'); return path.join(this.getEngineDirectory(), `${name}-${suffix}`);