Nick: fixes

This commit is contained in:
Nicolas 2025-03-13 13:05:12 -04:00
parent 134de67a3b
commit 7ec278a908
2 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,9 @@
import { supabase_rr_service, supabase_service } from "../../services/supabase"; import { supabase_rr_service, supabase_service } from "../../services/supabase";
import { logger } from "../logger"; import { logger } from "../logger";
export async function getTeamIdSyncB(teamId: string) { import { withAuth } from "../withAuth";
async function getTeamIdSyncBOriginal(teamId: string) {
try { try {
const { data, error } = await supabase_rr_service const { data, error } = await supabase_rr_service
.from("eb-sync") .from("eb-sync")
@ -17,3 +19,5 @@ export async function getTeamIdSyncB(teamId: string) {
return null; return null;
} }
} }
export const getTeamIdSyncB = withAuth(getTeamIdSyncBOriginal, null);

View File

@ -79,7 +79,7 @@ async function addScrapeJobRaw(
// If above by 2x, send them an email // 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 // No need to 2x as if there are more than the max concurrency in the concurrency queue, it is already 2x
if(concurrencyQueueJobs > maxConcurrency) { 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) => { // sendNotificationWithCustomDays(webScraperOptions.team_id, NotificationType.CONCURRENCY_LIMIT_REACHED, 10, false).catch((error) => {
// logger.error("Error sending notification (concurrency limit reached): ", error); // logger.error("Error sending notification (concurrency limit reached): ", error);
// }); // });
@ -168,7 +168,7 @@ export async function addScrapeJobs(
// equals 2x the max concurrency // equals 2x the max concurrency
if(addToCQ.length > maxConcurrency) { 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) => { // sendNotificationWithCustomDays(jobs[0].data.team_id, NotificationType.CONCURRENCY_LIMIT_REACHED, 10, false).catch((error) => {
// logger.error("Error sending notification (concurrency limit reached): ", error); // logger.error("Error sending notification (concurrency limit reached): ", error);
// }); // });