Skip to content

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

chore: remove ingestion via bullmq (#8143)

Max Deichmann1ea643300dec
diff --git a/web/src/pages/api/admin/bullmq/index.ts b/web/src/pages/api/admin/bullmq/index.ts
index fea3fcf32c..960cee9fbb 100644
--- a/web/src/pages/api/admin/bullmq/index.ts
+++ b/web/src/pages/api/admin/bullmq/index.ts
@@ -6,10 +6,8 @@ import {
getQueue,
IngestionQueue,
IngestionEvent,
- QueueJobs,
} from "@langfuse/shared/src/server";
import { AdminApiAuthService } from "@/src/ee/features/admin-api/server/adminApiAuth";
-import { v4 } from "uuid";
/*
This API route is used by Langfuse Cloud to retry failed bullmq jobs.
@@ -164,34 +162,32 @@ export default async function handler(
return res.status(200).json({ message: "Retried all jobs" });
}
- if (req.method === "POST" && body.data.action === "add") {
- logger.info(
- `Adding ${body.data.events.length} events to ${body.data.queueName}`,
- );
-
- try {
- const startTime = Date.now();
- await insertJobs({
- queueName: body.data.queueName,
- data: body.data.events,
- });
- const durationMs = Date.now() - startTime;
-
- logger.info(
- `Successfully added ${body.data.events.length} events to ${body.data.queueName} in ${durationMs}ms`,
- );
-
- return res.status(200).json({
- message: `Added ${body.data.events.length} events to ${body.data.queueName} in ${durationMs}ms`,
- count: body.data.events.length,
- });
- } catch (error) {
- logger.error(`Failed to add events to ${body.data.queueName}`, error);
- return res.status(500).json({
- error: `Failed to add events to queue: ${error instanceof Error ? error.message : "Unknown error"}`,
- });
- }
- }
+ // if (req.method === "POST" && body.data.action === "add") {
+ // logger.info(
+ // `Adding ${body.data.events.length} events to ${body.data.queueName}`,
+ // );
+
+ // try {
+ // await insertJobs({
+ // queueName: body.data.queueName,
+ // data: body.data.events,
+ // });
+
+ // logger.info(
+ // `Successfully added ${body.data.events.length} events to ${body.data.queueName}`,
+ // );
+
+ // return res.status(200).json({
+ // message: `Added ${body.data.events.length} events to ${body.data.queueName}`,
+ // count: body.data.events.length,
+ // });
+ // } catch (error) {
+ // logger.error(`Failed to add events to ${body.data.queueName}`, error);
+ // return res.status(500).json({
+ // error: `Failed to add events to queue: ${error instanceof Error ? error.message : "Unknown error"}`,
+ // });
+ // }
+ // }
// return not implemented error
res.status(404).json({ error: "Action does not exist" });
@@ -201,31 +197,31 @@ export default async function handler(
}
}
-const insertJobType = z.discriminatedUnion("queueName", [
- z.object({
- queueName: z.literal(QueueName.IngestionSecondaryQueue),
- data: z.array(IngestionEvent),
- }),
-]);
-
-const insertJobs = async (payload: z.infer<typeof insertJobType>) => {
- const queue = getQueue(
- payload.queueName as Exclude<QueueName, QueueName.IngestionQueue>,
- );
-
- if (!queue) {
- throw new Error("Failed to get queue");
- }
-
- await queue.addBulk(
- payload.data.map((data) => ({
- name: QueueJobs.IngestionSecondaryJob,
- data: {
- id: v4(),
- timestamp: new Date(),
- name: QueueJobs.IngestionSecondaryJob,
- payload: data,
- },
- })),
- );
-};
+// const insertJobType = z.discriminatedUnion("queueName", [
+// z.object({
+// queueName: z.literal(QueueName.IngestionSecondaryQueue),
+// data: z.array(IngestionEvent),
+// }),
+// ]);
+
+// const insertJobs = async (payload: z.infer<typeof insertJobType>) => {
+// const queue = getQueue(
+// payload.queueName as Exclude<QueueName, QueueName.IngestionQueue>,
+// );
+
+// if (!queue) {
+// throw new Error("Failed to get queue");
+// }
+
+// await queue.addBulk(
+// payload.data.map((data) => ({
+// name: QueueJobs.IngestionSecondaryJob,
+// data: {
+// id: v4(),
+// timestamp: new Date(),
+// name: QueueJobs.IngestionSecondaryJob,
+// payload: data,
+// },
+// })),
+// );
+// };