We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f8e1a6 commit 277bb8aCopy full SHA for 277bb8a
lib/cache.ts
@@ -13,7 +13,7 @@ import { join } from "path";
13
// to be this simple and this is easy to write.
14
//
15
16
-const duration = 1000 * 60 * 60 * 24;
+const expiryInSeconds = 1000 * 60 * 60 * 24;
17
18
const basedir = join(process.cwd(), ".cache");
19
mkdirSync(basedir, { recursive: true });
@@ -44,7 +44,10 @@ const get = (key: string): any => {
44
const set = (key: string, data: any): void => {
45
console.log("cache: write %s", key);
46
const path = join(basedir, keyToFilename(key));
47
- const obj = JSON.stringify({ expiration: Date.now() + duration, data });
+ const obj = JSON.stringify({
48
+ expiration: Date.now() + expiryInSeconds,
49
+ data,
50
+ });
51
writeFileSync(path, obj, "utf8");
52
};
53
0 commit comments