Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore: increase web container grace period (#2641)

Max Deichmann8746bcf54fa5
diff --git a/web/src/pages/api/public/ingestion.ts b/web/src/pages/api/public/ingestion.ts
index 5c30ccae8c..b42e4cb3e0 100644
--- a/web/src/pages/api/public/ingestion.ts
+++ b/web/src/pages/api/public/ingestion.ts
@@ -40,6 +40,7 @@ import {
ForbiddenError,
UnauthorizedError,
} from "@langfuse/shared";
+import { isSigtermReceived } from "@/src/utils/shutdown";
export const config = {
api: {
@@ -202,7 +203,9 @@ export const handleBatch = async (
req: NextApiRequest,
authCheck: AuthHeaderVerificationResult,
) => {
- console.log(`handling ingestion ${events.length} events`);
+ console.log(
+ `handling ingestion ${events.length} events ${isSigtermReceived() ? "after SIGTERM" : ""}`,
+ );
if (!authCheck.validKey) throw new UnauthorizedError(authCheck.error);
diff --git a/web/src/utils/shutdown.ts b/web/src/utils/shutdown.ts
index 50c7c28f33..5708e067ef 100644
--- a/web/src/utils/shutdown.ts
+++ b/web/src/utils/shutdown.ts
@@ -4,7 +4,7 @@
// NEVER call process.exit() in this process. Kubernetes should kill the container: https://kostasbariotis.com/why-you-should-not-use-process-exit/
// We wait for 20 seconds to allow the app to finish processing requests. There is no native way to do this in Next.js.
-const TIMEOUT = 120_000;
+const TIMEOUT = 240_000;
declare global {
// eslint-disable-next-line no-var