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
*/
export const supabaseGetJobsById = async (jobIds: string[]) => {
const { data, error } = await supabase_service.rpc("get_jobs_by_ids", {
job_ids: jobIds,
});
const { data, error } = await supabase_service
.from("firecrawl_jobs")
.select()
.in("job_id", jobIds);
if (error) {
Logger.error(`Error in get_jobs_by_ids: ${error}`);
Logger.error(`Error in supabaseGetJobsById: ${error}`);
Sentry.captureException(error);
return [];
}