Skip to content

Commit 0a266c3

Browse files
committed
invlidateByTag
1 parent 98ed142 commit 0a266c3

File tree

1 file changed

+2
-5
lines changed
  • packages/fern-docs/bundle/src/app/[host]/[domain]/api/fern-docs/revalidate

1 file changed

+2
-5
lines changed

packages/fern-docs/bundle/src/app/[host]/[domain]/api/fern-docs/revalidate/route.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { getEnv, waitUntil } from "@vercel/functions";
2929
import { kv } from "@vercel/kv";
3030
import { mapValues } from "es-toolkit/object";
3131
import { escapeRegExp } from "es-toolkit/string";
32-
import { revalidatePath, revalidateTag } from "next/cache";
32+
import { invalidateByTag } from '@vercel/functions';
3333
import { type NextRequest, NextResponse } from "next/server";
3434
import { UnreachableCaseError } from "ts-essentials";
3535
import { getFaiClient } from "@/getFaiClient";
@@ -63,10 +63,7 @@ export async function GET(
6363
const start = performance.now();
6464

6565
const { host, domain } = await props.params;
66-
revalidateTag(domain);
67-
68-
// delay to ensure invalidation propagates before cache is accessed
69-
await new Promise((resolve) => setTimeout(resolve, 500));
66+
await invalidateByTag(domain);
7067

7168
const stream = new ReadableStream({
7269
async start(controller) {

0 commit comments

Comments
 (0)