Skip to content

Commit

Permalink
move memory limit to after preconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Lobz committed May 29, 2024
1 parent 1b94406 commit 070a34c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docker/R/corretor.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ corretoR <- function (precondi, testes, texto) {
# Executa as precondicoes
if(!no.results(precondi)) eval(parse(text=precondi), envir=corrEnv);

# Limits memory usage
rlimit_as(1e10);
rlimit_cpu(15);

# Executa o texto da resposta
getError <- try(eval(
c(parse(text=texto),"TRUE"), # Evita que o codigo retorne matrizes
Expand Down Expand Up @@ -55,9 +59,6 @@ corretoR <- function (precondi, testes, texto) {
notaR <- function (id.exerc, arquivo) {
# import files
file.copy(list.files("/arquivos/", recursive=TRUE, full.names=TRUE), ".");
# Limits memory usage
rlimit_as(1e10);
rlimit_cpu(15);
# Read file
texto <- readLines(arquivo, encoding="utf8");
# Get exercicio
Expand Down

0 comments on commit 070a34c

Please sign in to comment.