Skip to content

Commit

Permalink
fix(scraper): log job abort
Browse files Browse the repository at this point in the history
  • Loading branch information
mytlogos committed Sep 5, 2022
1 parent 64edab9 commit 654935e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/scraper/src/scheduler/jobScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,16 @@ export class JobScheduler {
// if aborting did not finish the job after 5 min
// stop this process and exit as graceful as possible
if (job.getRunningDuration() > hardMaxJobRunningTime) {
logger.error("Restarting Process due to long running jobs", {
logger.error("restarting Process due to long running job", {
job_name: job.currentItem.name,
job_id: job.id,
});
gracefulShutdown();
} else if (!job.isAborted()) {
logger.error("aborting long running job", {
job_name: job.currentItem.name,
job_id: job.id,
});
job.abort();
}
}
Expand Down

0 comments on commit 654935e

Please sign in to comment.