Reduce concurrency only when building prod image

This commit is contained in:
Radon Rosborough 2020-08-22 19:54:01 -06:00
parent 5610772c15
commit 8af94f9002
2 changed files with 8 additions and 3 deletions

View File

@ -68,4 +68,4 @@ RUN sudo cp -a /tmp/riju/* /home/docker/src/ && rm -rf /tmp/riju
WORKDIR /home/docker/src
RUN sudo deluser docker sudo
RUN RIJU_PRIVILEGED=1 yarn test
RUN RIJU_PRIVILEGED=1 TIMEOUT_SECS=20 yarn test

View File

@ -10,8 +10,13 @@ import { v4 as getUUID } from "uuid";
import * as api from "./api";
import { LangConfig, langs } from "./langs";
const TIMEOUT_SECS = 5;
const CONCURRENCY = 1;
function parseIntOr(thing: any, def: number) {
const num = parseInt(thing);
return Number.isNaN(num) ? def : num;
}
const TIMEOUT_SECS = parseIntOr(process.env.TIMEOUT, 5);
const CONCURRENCY = parseIntOr(process.env.CONCURRENCY, 2);
function findPosition(str: string, idx: number) {
const lines = str.substring(0, idx).split("\n");