From fa6893eeb3255f40a51cecba38cc203053eb5a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=AE=E3=83=A3=E3=83=A9?= Date: Sun, 23 Oct 2022 17:00:16 +0900 Subject: [PATCH] feat: Allow specify cache in App opts. --- src/app.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index 3b06bab..73a7cd2 100644 --- a/src/app.ts +++ b/src/app.ts @@ -24,6 +24,7 @@ export type Opts = { exporter: string; noProgress: boolean; monitor: boolean; + cache?: Cache; }; export const DEFAULT_OPTS: Opts = { @@ -225,7 +226,7 @@ export class App { const exporters = await this.getExporters(); const fetcher = new BattleFetcher({ - cache: new FileCache(this.state.cacheDir), + cache: this.opts.cache ?? new FileCache(this.state.cacheDir), state: this.state, }); console.log("Fetching battle list...");