2024-05-09 02:38:46 +08:00
|
|
|
import { supabase_service } from "./supabase";
|
|
|
|
import { WebsiteScrapeError } from "./types";
|
|
|
|
|
2024-05-09 03:18:53 +08:00
|
|
|
export async function logErrors(dataError: WebsiteScrapeError[], time_taken: number, num_tokens:number, score: number, num_pages_tested: number,) {
|
2024-05-09 02:38:46 +08:00
|
|
|
try {
|
2024-05-09 03:18:53 +08:00
|
|
|
await supabase_service.from("test_suite_logs").insert([{log:dataError, time_taken, num_tokens, score, num_pages_tested, is_error: dataError.length > 0}]);
|
2024-05-09 02:38:46 +08:00
|
|
|
} catch (error) {
|
|
|
|
console.error(`Error logging to supabase: ${error}`);
|
|
|
|
}
|
|
|
|
}
|