Skip to content

Commit c48f2ef

Browse files
committed
Added option to test the new instrumentation config
1 parent 5d0e0ef commit c48f2ef

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

examples/redis-minimal/.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
NEXT_PRIVATE_DEBUG_CACHE="1"
22
REDIS_URL="redis://localhost:6379"
3-
REDIS_SINGLE_CONNECTION=true
3+
REDIS_SINGLE_CONNECTION=true
4+
#INITIAL_CACHE_SET_ONLY_IF_NOT_EXISTS=true
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
export const register = async () => {
22
if (process.env.NEXT_RUNTIME === "nodejs") {
3-
const { registerInitialCache } = await import(
4-
"@fortedigital/nextjs-cache-handler/instrumentation"
5-
);
3+
const { registerInitialCache } =
4+
await import("@fortedigital/nextjs-cache-handler/instrumentation");
65
const CacheHandler = (await import("../cache-handler.mjs")).default;
7-
await registerInitialCache(CacheHandler);
6+
await registerInitialCache(CacheHandler, {
7+
setOnlyIfNotExists:
8+
process.env.INITIAL_CACHE_SET_ONLY_IF_NOT_EXISTS === "true",
9+
});
810
}
911
};

0 commit comments

Comments
 (0)