Skip to content

Commit

Permalink
refactor; add timeout on target after they say they begin identifying
Browse files Browse the repository at this point in the history
  • Loading branch information
sanoel committed Jun 26, 2024
1 parent a64faa5 commit c2b77b6
Show file tree
Hide file tree
Showing 4 changed files with 528 additions and 523 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@
"resolutions": {
"@oada/jobs": "portal:/home/sanoel/jobs"
}
}
}
8 changes: 8 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ const config = convict({
},
},
timeouts: {
simx: {
doc: 'Timeout duration for Target themselves',
format: 'duration',
// The types for duration suck
default: 3_600_000 as unknown as number,
env: 'SIMX_TIMEOUT',
arg: 'simx-timeout',
},
pdf: {
doc: 'Timeout duration for PDF jobs',
format: 'duration',
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ await Promise.all(
}); // 1 concurrent job

// --------------------------------------------------
// Set the job type handlers
service.on('transcription', config.get('timeouts.pdf'), pdfJobHandler);
// Set the job type handlers; timeout the job 2 minutes longer than target
service.on('transcription', config.get('timeouts.pdf') + 120_000, pdfJobHandler);
// Service.on('asn', config.get('timeouts.asn'), asnJobHandler);

// --------------------------------------------------
Expand Down
Loading

0 comments on commit c2b77b6

Please sign in to comment.