feat(judge): add revalidation for problem page after submission

This commit is contained in:
cfngc4594 2025-04-13 11:16:26 +08:00
parent fd50e72518
commit 7d7e503c8e

View File

@ -8,6 +8,7 @@ import { auth } from "@/lib/auth";
import { redirect } from "next/navigation";
import { Readable, Writable } from "stream";
import { Status } from "@/generated/client";
import { revalidatePath } from "next/cache";
import type { ProblemWithTestcases, TestcaseWithDetails } from "@/types/prisma";
import type { EditorLanguage, Submission, TestcaseResult } from "@/generated/client";
@ -220,6 +221,7 @@ export async function judge(
return submission;
}
} finally {
revalidatePath(`/problems/${problemId}`);
if (container) {
try {
await container.kill();