Skip to content

Commit

Permalink
source corretor now in R layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Lobz committed May 20, 2024
1 parent 9f7760e commit 6c0e1a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/ExercicioController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') . '";'
Expand All @@ -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);'
Expand Down
2 changes: 1 addition & 1 deletion docker/R/bootstrap.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library(Rserve);
library(unix);
source("/usr/local/src/notar/corretor.R");
run.Rserve(remote=TRUE);

0 comments on commit 6c0e1a4

Please sign in to comment.