Refactor: use ROOT_DIR

This commit is contained in:
SukkaW
2025-01-10 20:22:30 +08:00
parent 57dc1b6787
commit 8340a0f4f5
6 changed files with 12 additions and 8 deletions

View File

@@ -16,6 +16,7 @@ export type UndiciResponseData<T = unknown> = Dispatcher.ResponseData<T>;
import { inspect } from 'node:util';
import path from 'node:path';
import { ROOT_DIR } from '../constants/dir';
const agent = new Agent({});
@@ -105,7 +106,7 @@ setGlobalDispatcher(agent.compose(
}),
interceptors.cache({
store: new BetterSqlite3CacheStore({
location: path.resolve(__dirname, '../../.cache/undici-better-sqlite3-cache-store.db'),
location: path.join(ROOT_DIR, '.cache/undici-better-sqlite3-cache-store.db'),
maxEntrySize: 1024 * 1024 * 50 // 50 MiB
})
})