diff --git a/app/Http/Controllers/ExercicioController.php b/app/Http/Controllers/ExercicioController.php index c720fcf..2a6aaa0 100644 --- a/app/Http/Controllers/ExercicioController.php +++ b/app/Http/Controllers/ExercicioController.php @@ -170,7 +170,7 @@ private function corretoR(Exercicio $exercicio, string $file) try { $cnx = new Connection('r'); - $rcode = 'source("/usr/local/src/notar/corretor.R");' + $rcode = '' // database auth . 'dbusr <- "' . env('DB_USERNAME') . '";' . 'dbpass <- "' . env('DB_PASSWORD') . '";' @@ -180,7 +180,7 @@ private function corretoR(Exercicio $exercicio, string $file) . 'file.copy(list.files("/arquivos/",recursive=TRUE,full.names=TRUE),".");' // Limits memory usage . 'rlimit_as(1e10);' - . 'rlimit_cpu(1);' + . 'rlimit_cpu(15);' // run corretoR . 'res <- notaR(' . $exercicio->id . ',"' . $file . '");' . 'unlink("*",recursive=TRUE);' diff --git a/docker/R/bootstrap.R b/docker/R/bootstrap.R index b38312a..4c33f90 100644 --- a/docker/R/bootstrap.R +++ b/docker/R/bootstrap.R @@ -1,4 +1,4 @@ library(Rserve); library(unix); +source("/usr/local/src/notar/corretor.R"); run.Rserve(remote=TRUE); -