From 6c0e1a43abf9a5a18d248fbe002caee84a72d933 Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Mon, 20 May 2024 17:32:17 -0300 Subject: [PATCH] source corretor now in R layer --- app/Http/Controllers/ExercicioController.php | 4 ++-- docker/R/bootstrap.R | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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); -