Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(search): delete jobs after done

Gergő Móriczefb91f9ca5e0
diff --git a/apps/api/src/controllers/search.ts b/apps/api/src/controllers/search.ts
index 873922c4d..45105bb4f 100644
--- a/apps/api/src/controllers/search.ts
+++ b/apps/api/src/controllers/search.ts
@@ -103,6 +103,8 @@ export async function searchHelper(
return { success: true, error: "No search results found", returnCode: 200 };
}
+ await Promise.all(jobs.map(x => x.remove()));
+
// make sure doc.content is not empty
const filteredDocs = docs.filter(
(doc: { content?: string }) => doc.content && doc.content.trim().length > 0