Skip to content

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

fix(nuq): reduce addJobs batch size to hold less locks

Gergő Móricza6119769e004
diff --git a/apps/api/src/services/worker/nuq.ts b/apps/api/src/services/worker/nuq.ts
index 383e6b1ba..d84885f00 100644
--- a/apps/api/src/services/worker/nuq.ts
+++ b/apps/api/src/services/worker/nuq.ts
@@ -800,8 +800,9 @@ class NuQ<JobData = any, JobReturnValue = any> {
const results: NuQJob<JobData, JobReturnValue>[] = [];
// Batch size: 6 params per job, stay well under PG's 65535 param limit
- // 1000 jobs = 6000 params, leaving plenty of headroom
- const BATCH_SIZE = 1000;
+ // 200 jobs = 1200 params, leaving plenty of headroom
+ // lowered to reduce held locks - mogery
+ const BATCH_SIZE = 200;
// Helper function to build and execute bulk insert with batching
const bulkInsert = async (