Skip to content

Commit

Permalink
handle stdout and stderr limits properly (#643)
Browse files Browse the repository at this point in the history
* handle stdout and stderr limits proberly

Co-authored-by: Omar Brikaa <[email protected]>

* added environment to docker compose

---------

Co-authored-by: Omar Brikaa <[email protected]>
  • Loading branch information
AbsoluteZero000 and Brikaa authored Jan 26, 2024
1 parent b46690d commit 647bc3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/src/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
Expand Down

0 comments on commit 647bc3a

Please sign in to comment.