1
0
Fork 0
mirror of https://gitbruv.vercel.app/api/git/bruv/gitbruv.git synced 2025-12-20 23:24:09 +01:00
This commit is contained in:
Ahmet Kilinc 2025-12-20 11:29:22 +00:00
parent bdcdfc7450
commit fa297f7b7a
2 changed files with 1 additions and 6 deletions

View file

@ -670,7 +670,3 @@ export async function getRepoPageData(owner: string, repoName: string) {
isOwner, isOwner,
}; };
} }
export function getRepoCacheTag(owner: string, repoName: string) {
return `repo:${owner}/${repoName}`;
}

View file

@ -7,7 +7,6 @@ import { createR2Fs, getRepoPrefix } from "@/lib/r2-fs";
import { scryptAsync } from "@noble/hashes/scrypt.js"; import { scryptAsync } from "@noble/hashes/scrypt.js";
import { hexToBytes } from "@noble/hashes/utils.js"; import { hexToBytes } from "@noble/hashes/utils.js";
import { revalidateTag } from "next/cache"; import { revalidateTag } from "next/cache";
import { getRepoCacheTag } from "@/actions/repositories";
function constantTimeEqual(a: Uint8Array, b: Uint8Array): boolean { function constantTimeEqual(a: Uint8Array, b: Uint8Array): boolean {
if (a.length !== b.length) return false; if (a.length !== b.length) return false;
@ -439,7 +438,7 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
response = await handleUploadPack(fs, "/", body); response = await handleUploadPack(fs, "/", body);
} else { } else {
response = await handleReceivePack(fs, "/", body); response = await handleReceivePack(fs, "/", body);
revalidateTag(getRepoCacheTag(username, repoName), { expire: 0 }); revalidateTag(`repo:${username}/${repoName}`, { expire: 0 });
} }
return new NextResponse(new Uint8Array(response), { return new NextResponse(new Uint8Array(response), {