fix(supabase-jobs): do not use RPCs

RPCs are more failure-prone for this use case than regular queries are.
This commit is contained in:
Gergo Moricz 2024-09-10 09:20:18 +02:00
parent a6bcf7b438
commit f8fbc71f91

View File

@ -31,12 +31,13 @@ export const supabaseGetJobById = async (jobId: string) => {
* @returns {any[]} Jobs * @returns {any[]} Jobs
*/ */
export const supabaseGetJobsById = async (jobIds: string[]) => { export const supabaseGetJobsById = async (jobIds: string[]) => {
const { data, error } = await supabase_service.rpc("get_jobs_by_ids", { const { data, error } = await supabase_service
job_ids: jobIds, .from("firecrawl_jobs")
}); .select()
.in("job_id", jobIds);
if (error) { if (error) {
Logger.error(`Error in get_jobs_by_ids: ${error}`); Logger.error(`Error in supabaseGetJobsById: ${error}`);
Sentry.captureException(error); Sentry.captureException(error);
return []; return [];
} }