handle stdout and stderr limits proberly
Co-authored-by: Omar Brikaa <brikaaomar@gmail.com>
This commit is contained in:
parent
b46690de06
commit
a446ebe5bb
|
@ -221,7 +221,7 @@ class Job {
|
||||||
proc.stderr.on('data', async data => {
|
proc.stderr.on('data', async data => {
|
||||||
if (event_bus !== null) {
|
if (event_bus !== null) {
|
||||||
event_bus.emit('stderr', data);
|
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`);
|
this.logger.info(`stderr length exceeded`);
|
||||||
try {
|
try {
|
||||||
process.kill(proc.pid, 'SIGKILL');
|
process.kill(proc.pid, 'SIGKILL');
|
||||||
|
@ -242,7 +242,7 @@ class Job {
|
||||||
proc.stdout.on('data', async data => {
|
proc.stdout.on('data', async data => {
|
||||||
if (event_bus !== null) {
|
if (event_bus !== null) {
|
||||||
event_bus.emit('stdout', data);
|
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`);
|
this.logger.info(`stdout length exceeded`);
|
||||||
try {
|
try {
|
||||||
process.kill(proc.pid, 'SIGKILL');
|
process.kill(proc.pid, 'SIGKILL');
|
||||||
|
|
|
@ -11,8 +11,6 @@ services:
|
||||||
- 2000:2000
|
- 2000:2000
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/piston/packages:/piston/packages
|
- ./data/piston/packages:/piston/packages
|
||||||
environment:
|
|
||||||
- PISTON_REPO_URL=http://repo:8000/index
|
|
||||||
tmpfs:
|
tmpfs:
|
||||||
- /piston/jobs:exec,uid=1000,gid=1000,mode=711
|
- /piston/jobs:exec,uid=1000,gid=1000,mode=711
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue