Skip to content

Commit ebbebf8

Browse files
committed
feat(ghc.ts): add configurable cache TTL based on LOCAL_DEV environment variable to improve development experience
style(ghc.ts): format code for better readability and maintainability
1 parent afd57be commit ebbebf8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ghc.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export type GH = ghComponents["schemas"];
1818

1919
const CACHE_DIR = path.join(process.cwd(), "node_modules/.cache/Comfy-PR");
2020
const CACHE_FILE = path.join(CACHE_DIR, "gh-cache.sqlite");
21-
const DEFAULT_TTL = 30 * 60 * 1000; // 30 minutes
21+
const DEFAULT_TTL = process.env.LOCAL_DEV
22+
? 30 * 60 * 1000 // cache 30 minutes when local dev
23+
: 1 * 60 * 1000; // cache 1 minute in production
2224

2325
await fs.mkdir(CACHE_DIR, { recursive: true });
2426

0 commit comments

Comments
 (0)