Skip to content

Commit 33c238b

Browse files
committed
undo directory change as it breaks build
1 parent 8566368 commit 33c238b

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

packages/cloudflare/src/api/r2-incremental-cache.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ import { getCloudflareContext } from "./cloudflare-context.js";
1717
class R2IncrementalCache implements IncrementalCache {
1818
readonly name = "r2-incremental-cache";
1919

20-
protected directory: string;
21-
22-
constructor() {
23-
this.directory = getCloudflareContext().env.NEXT_CACHE_R2_PREFIX ?? "incremental-cache";
24-
}
25-
2620
async get<IsFetch extends boolean = false>(
2721
key: string,
2822
isFetch?: IsFetch
@@ -77,7 +71,9 @@ class R2IncrementalCache implements IncrementalCache {
7771
}
7872

7973
protected getR2Key(key: string, isFetch?: boolean): string {
80-
return `${this.directory}/${process.env.NEXT_BUILD_ID ?? "no-build-id"}/${key}.${isFetch ? "fetch" : "cache"}`;
74+
const directory = getCloudflareContext().env.NEXT_CACHE_R2_PREFIX ?? "incremental-cache";
75+
76+
return `${directory}/${process.env.NEXT_BUILD_ID ?? "no-build-id"}/${key}.${isFetch ? "fetch" : "cache"}`;
8177
}
8278
}
8379

0 commit comments

Comments
 (0)