Skip to content

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

chore: nuq prefetch count (#2869)

delong3862a1ae02a23
diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.ts
index c421dcd5d..07072ede8 100644
--- a/apps/api/src/controllers/auth.ts
+++ b/apps/api/src/controllers/auth.ts
@@ -491,20 +491,21 @@ async function supaAuthenticateUser(
try {
await rateLimiter.consume(team_endpoint_token);
} catch (rateLimiterRes) {
- logger.error(`Rate limit exceeded: ${rateLimiterRes}`, {
- teamId,
- priceId,
- mode,
- rateLimits: chunk?.rate_limits,
- rateLimiterRes,
- });
+ // logger.error(`Rate limit exceeded: ${rateLimiterRes}`, {
+ // teamId,
+ // priceId,
+ // mode,
+ // rateLimits: chunk?.rate_limits,
+ // rateLimiterRes,
+ // });
+
const secs = Math.round(rateLimiterRes.msBeforeNext / 1000) || 1;
const retryDate = new Date(Date.now() + rateLimiterRes.msBeforeNext);
// We can only send a rate limit email every 7 days, send notification already has the date in between checking
- const startDate = new Date();
- const endDate = new Date();
- endDate.setDate(endDate.getDate() + 7);
+ // const startDate = new Date();
+ // const endDate = new Date();
+ // endDate.setDate(endDate.getDate() + 7);
// await sendNotification(team_id, NotificationType.RATE_LIMIT_REACHED, startDate.toISOString(), endDate.toISOString());
diff --git a/apps/api/src/services/worker/nuq.ts b/apps/api/src/services/worker/nuq.ts
index 58e83f98f..060fd7568 100644
--- a/apps/api/src/services/worker/nuq.ts
+++ b/apps/api/src/services/worker/nuq.ts
@@ -100,7 +100,7 @@ class NuQ<JobData = any, JobReturnValue = any> {
try {
const connection = await amqp.connect(config.NUQ_RABBITMQ_URL);
const channel = await connection.createChannel();
- await channel.prefetch(1);
+ await channel.prefetch(5);
const queue = await channel.assertQueue(
this.queueName + ".listen." + this.listenChannelId,
{