-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b31e68
commit d2f808a
Showing
1 changed file
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ getWebScraperQueue().process( | |
current_url: "", | ||
}); | ||
const start = Date.now(); | ||
|
||
const { success, message, docs } = await startWebScraperPipeline({ job }); | ||
const end = Date.now(); | ||
const timeTakenInSeconds = (end - start) / 1000; | ||
|
@@ -74,6 +74,19 @@ getWebScraperQueue().process( | |
"Something went wrong... Contact [email protected] or try again." /* etc... */, | ||
}; | ||
await callWebhook(job.data.team_id, data); | ||
await logJob({ | ||
success: false, | ||
message: typeof error === 'string' ? error : (error.message ?? "Something went wrong... Contact [email protected]"), | ||
num_docs: 0, | ||
docs: [], | ||
time_taken: 0, | ||
team_id: job.data.team_id, | ||
mode: "crawl", | ||
url: job.data.url, | ||
crawlerOptions: job.data.crawlerOptions, | ||
pageOptions: job.data.pageOptions, | ||
origin: job.data.origin, | ||
}); | ||
done(null, data); | ||
} | ||
} | ||
|