fix(queue-worker): log jobs correctly
This commit is contained in:
@@ -149,6 +149,7 @@ async function processJob(job: Job, token: string) {
|
|||||||
await callWebhook(job.data.team_id, job.id as string, data);
|
await callWebhook(job.data.team_id, job.id as string, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (job.data.crawl_id) {
|
||||||
await logJob({
|
await logJob({
|
||||||
job_id: job.id as string,
|
job_id: job.id as string,
|
||||||
success: success,
|
success: success,
|
||||||
@@ -165,7 +166,6 @@ async function processJob(job: Job, token: string) {
|
|||||||
crawl_id: job.data.crawl_id,
|
crawl_id: job.data.crawl_id,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (job.data.crawl_id) {
|
|
||||||
await addCrawlJobDone(job.data.crawl_id, job.id);
|
await addCrawlJobDone(job.data.crawl_id, job.id);
|
||||||
|
|
||||||
const sc = await getCrawl(job.data.crawl_id) as StoredCrawl;
|
const sc = await getCrawl(job.data.crawl_id) as StoredCrawl;
|
||||||
@@ -301,6 +301,7 @@ async function processJob(job: Job, token: string) {
|
|||||||
await callWebhook(job.data.team_id, job.data.crawl_id ?? job.id as string, data);
|
await callWebhook(job.data.team_id, job.data.crawl_id ?? job.id as string, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (job.data.crawl_id) {
|
||||||
await logJob({
|
await logJob({
|
||||||
job_id: job.id as string,
|
job_id: job.id as string,
|
||||||
success: false,
|
success: false,
|
||||||
@@ -320,7 +321,6 @@ async function processJob(job: Job, token: string) {
|
|||||||
crawl_id: job.data.crawl_id,
|
crawl_id: job.data.crawl_id,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (job.data.crawl_id) {
|
|
||||||
const sc = await getCrawl(job.data.crawl_id);
|
const sc = await getCrawl(job.data.crawl_id);
|
||||||
|
|
||||||
await logJob({
|
await logJob({
|
||||||
|
|||||||
Reference in New Issue
Block a user