error handling + file size
This commit is contained in:
@@ -3,6 +3,9 @@ import { prisma } from "@/lib/db";
|
||||
import { getSessionUser } from "@/lib/auth";
|
||||
import { uploadToR2 } from "@/lib/r2";
|
||||
|
||||
// Route segment config for App Router - extend timeout for large uploads
|
||||
export const maxDuration = 300; // 5 minutes
|
||||
|
||||
const MAX_UPLOAD_SIZE = 10 * 1024 * 1024 * 1024; // 10GB in bytes
|
||||
|
||||
function serializeFile(file: Awaited<ReturnType<typeof prisma.file.create>>) {
|
||||
|
||||
Reference in New Issue
Block a user