mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-05 01:20:43 +08:00
fix(scrape-events): bad logic
This commit is contained in:
parent
7cd9bf92e3
commit
71072fef3b
@ -13,7 +13,7 @@ export type ScrapeScrapeEvent = {
|
|||||||
result: null | {
|
result: null | {
|
||||||
success: boolean,
|
success: boolean,
|
||||||
response_code?: number,
|
response_code?: number,
|
||||||
error?: string,
|
error?: string | object,
|
||||||
// proxy?: string,
|
// proxy?: string,
|
||||||
time_taken: number,
|
time_taken: number,
|
||||||
},
|
},
|
||||||
@ -31,13 +31,13 @@ export class ScrapeEvents {
|
|||||||
static async insert(jobId: string, content: ScrapeEvent) {
|
static async insert(jobId: string, content: ScrapeEvent) {
|
||||||
if (jobId === "TEST") return null;
|
if (jobId === "TEST") return null;
|
||||||
|
|
||||||
if (process.env.USE_DB_AUTH) {
|
if (process.env.USE_DB_AUTHENTICATION) {
|
||||||
const result = await supabase.from("scrape_events").insert({
|
const result = await supabase.from("scrape_events").insert({
|
||||||
job_id: jobId,
|
job_id: jobId,
|
||||||
type: content.type,
|
type: content.type,
|
||||||
content: content,
|
content: content,
|
||||||
// created_at
|
// created_at
|
||||||
}).single();
|
}).select().single();
|
||||||
return (result.data as any).id;
|
return (result.data as any).id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user