Compare commits

..

2 Commits

Author SHA1 Message Date
Gabriel Francischini C. Pereira 32a548daa0
Merge fc33860983 into 647bc3a7c7 2024-04-08 11:47:21 +03:00
Ahmed Wael 647bc3a7c7
handle stdout and stderr limits properly (#643)
* handle stdout and stderr limits proberly

Co-authored-by: Omar Brikaa <brikaaomar@gmail.com>

* added environment to docker compose

---------

Co-authored-by: Omar Brikaa <brikaaomar@gmail.com>
2024-01-26 19:41:28 +13:00
1 changed files with 2 additions and 2 deletions

View File

@ -221,7 +221,7 @@ class Job {
proc.stderr.on('data', async data => {
if (event_bus !== null) {
event_bus.emit('stderr', data);
} else if (stderr.length > this.runtime.output_max_size) {
} else if ((stderr.length + data.length) > this.runtime.output_max_size) {
this.logger.info(`stderr length exceeded`);
try {
process.kill(proc.pid, 'SIGKILL');
@ -242,7 +242,7 @@ class Job {
proc.stdout.on('data', async data => {
if (event_bus !== null) {
event_bus.emit('stdout', data);
} else if (stdout.length > this.runtime.output_max_size) {
} else if ((stdout.length + data.length) > this.runtime.output_max_size) {
this.logger.info(`stdout length exceeded`);
try {
process.kill(proc.pid, 'SIGKILL');