Skip to content

Commit 628076d

Browse files
Merge pull request #42 from RichardHooijmaijers/final_cran_refine
minor update monitoring
2 parents cc97964 + 6383cfb commit 628076d

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

R/module_run.R

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,18 @@ module_run_server <- function(id, r) {
139139
if(any(grepl("shinyMixR/temp/script",cmd)) & !any(grepl("prog\\.txt",cmd))){
140140
scrf <- sub("--file=","",cmd[grepl("shinyMixR/temp/script",cmd)])
141141
scrf <- try(readLines(scrf),silent=TRUE)
142-
runin <- grepl("modres <- try\\(nlmixr\\(",scrf)
142+
#runin <- grepl("modres <- try\\(nlmixr\\(",scrf)
143+
runin <- grepl("modres <- try\\(nlmixr2::nlmixr\\(",scrf)
143144
if(any(runin)){
144-
modf <- gsub("modres <- try\\(nlmixr\\(|,.*","",scrf[runin])
145-
ret$modf <- modf
146-
ret$time <- ps::ps_cpu_times(x)["user"]
147-
ret$pid <- ps::ps_pid(x)
145+
#modf <- gsub("modres <- try\\(nlmixr\\(|,.*","",scrf[runin])
146+
modf <- gsub("modres <- try\\(nlmixr2::nlmixr\\(|,.*","",scrf[runin])
147+
tim <- try(ps::ps_cpu_times(x)["user"],silent=TRUE)
148+
pid <- try(ps::ps_pid(x), silent=TRUE)
149+
if(!inherits(tim,"try-error") && !inherits(pid,"try-error")){
150+
ret$modf <- modf
151+
ret$time <- tim
152+
ret$pid <- pid
153+
}
148154
}
149155
}
150156
}

0 commit comments

Comments
 (0)