mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-22 04:56:30 +02:00
Add try catch on get_stats in timeout killer
This commit is contained in:
parent
25737baf82
commit
32f082fab7
1 changed files with 8 additions and 3 deletions
|
@ -236,9 +236,14 @@ class Job {
|
||||||
const kill_timeout =
|
const kill_timeout =
|
||||||
(timeout >= 0 &&
|
(timeout >= 0 &&
|
||||||
set_timeout(async _ => {
|
set_timeout(async _ => {
|
||||||
this.get_stats(proc.pid).then(stat => {
|
try {
|
||||||
stats.push(stat);
|
this.get_stats(proc.pid).then(stat => {
|
||||||
});
|
stats.push(stat);
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
this.logger.debug(`Got error while getting stats:`, e);
|
||||||
|
}
|
||||||
|
|
||||||
this.logger.info(`Timeout exceeded timeout=${timeout}`);
|
this.logger.info(`Timeout exceeded timeout=${timeout}`);
|
||||||
try {
|
try {
|
||||||
process.kill(proc.pid, 'SIGKILL');
|
process.kill(proc.pid, 'SIGKILL');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue