diff --git a/apps/api/src/lib/extract/team-id-sync.ts b/apps/api/src/lib/extract/team-id-sync.ts index 90a32651..e477583a 100644 --- a/apps/api/src/lib/extract/team-id-sync.ts +++ b/apps/api/src/lib/extract/team-id-sync.ts @@ -1,7 +1,9 @@ import { supabase_rr_service, supabase_service } from "../../services/supabase"; import { logger } from "../logger"; -export async function getTeamIdSyncB(teamId: string) { +import { withAuth } from "../withAuth"; + +async function getTeamIdSyncBOriginal(teamId: string) { try { const { data, error } = await supabase_rr_service .from("eb-sync") @@ -17,3 +19,5 @@ export async function getTeamIdSyncB(teamId: string) { return null; } } + +export const getTeamIdSyncB = withAuth(getTeamIdSyncBOriginal, null); diff --git a/apps/api/src/services/queue-jobs.ts b/apps/api/src/services/queue-jobs.ts index 7e2a6f03..bbb17d6b 100644 --- a/apps/api/src/services/queue-jobs.ts +++ b/apps/api/src/services/queue-jobs.ts @@ -79,7 +79,7 @@ async function addScrapeJobRaw( // If above by 2x, send them an email // No need to 2x as if there are more than the max concurrency in the concurrency queue, it is already 2x if(concurrencyQueueJobs > maxConcurrency) { - logger.info("Concurrency limited 2x (single) - ", "Concurrency queue jobs: ", concurrencyQueueJobs, "Max concurrency: ", maxConcurrency); + logger.info("Concurrency limited 2x (single) - ", "Concurrency queue jobs: ", concurrencyQueueJobs, "Max concurrency: ", maxConcurrency, "Team ID: ", webScraperOptions.team_id); // sendNotificationWithCustomDays(webScraperOptions.team_id, NotificationType.CONCURRENCY_LIMIT_REACHED, 10, false).catch((error) => { // logger.error("Error sending notification (concurrency limit reached): ", error); // }); @@ -168,7 +168,7 @@ export async function addScrapeJobs( // equals 2x the max concurrency if(addToCQ.length > maxConcurrency) { - logger.info("Concurrency limited 2x (multiple) - ", "Concurrency queue jobs: ", addToCQ.length, "Max concurrency: ", maxConcurrency); + logger.info("Concurrency limited 2x (multiple) - ", "Concurrency queue jobs: ", addToCQ.length, "Max concurrency: ", maxConcurrency, "Team ID: ", jobs[0].data.team_id); // sendNotificationWithCustomDays(jobs[0].data.team_id, NotificationType.CONCURRENCY_LIMIT_REACHED, 10, false).catch((error) => { // logger.error("Error sending notification (concurrency limit reached): ", error); // });