Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
jlopez
sagJL
Commits
dfec4567
Commit
dfec4567
authored
Sep 22, 2020
by
mmassaviol
Browse files
Update running mecanism
parent
879fac2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.R
View file @
dfec4567
...
...
@@ -660,6 +660,12 @@ generate_pages_server <- function() {
res
<-
res
+
'\t\tif (!file.exists(paste0(input$results_dir,"/logs/runlog.txt"))){\n'
res
<-
res
+
'\t\t\tfile.create(paste0(input$results_dir,"/logs/runlog.txt"))\n'
res
<-
res
+
'\t\t}\n'
res
<-
res
+
'\t\tif (file.exists(paste0(input$results_dir,"/logs/workflow_end.ok"))){\n'
res
<-
res
+
'\t\t\tfile.remove(paste0(input$results_dir,"/logs/workflow_end.ok"))\n'
res
<-
res
+
'\t\t}\n'
res
<-
res
+
'\t\tif (file.exists(paste0(input$results_dir,"/logs/workflow_end.error"))){\n'
res
<-
res
+
'\t\t\tfile.remove(paste0(input$results_dir,"/logs/workflow_end.error"))\n'
res
<-
res
+
'\t\t}\n'
# res <- res + '\t\tforcerun = compare_params(input$results_dir)\n'
# res <- res + '\t\tif (length(forcerun>1)){\n'
...
...
@@ -1049,6 +1055,7 @@ generate_app <- function() {
# Observe if the workflow is running
res
<-
res
+
'\tobserve({\n'
res
<-
res
+
'\t\trv$timer()\n'
res
<-
res
+
'\t\tif (!file.exists(paste0(input$results_dir,"/logs/workflow.running"))){rv$running = F}\n'
res
<-
res
+
'\t\tif (isolate(rv$running)){\n'
res
<-
res
+
'\t\t\tif (file.exists(paste0(input$results_dir,"/logs/runlog.txt"))){\n'
res
<-
res
+
'\t\t\t\trv$textstream <- paste(readLines(paste0(input$results_dir,"/logs/runlog.txt"),warn=F), collapse = "<br/>")\n'
...
...
@@ -1065,15 +1072,11 @@ generate_app <- function() {
res
<-
res
+
'\t\t\t\taddResourcePath("results", input$results_dir)\n'
res
<-
res
+
'\t\t\t\toutUI = tags$iframe(src=paste0("results/multiqc_report.html"),width="100%", height="900px")\n'
res
<-
res
+
'\t\t\t\toutput$report_html = renderUI(outUI)\n'
res
<-
res
+
'\t\t\t\tfile.remove(paste0(input$results_dir,"/logs/workflow_end.ok"))\n'
res
<-
res
+
'\t\t\t\tfile.remove(paste0(input$results_dir,"/logs/workflow.running"))\n'
res
<-
res
+
'\t\t\t}\n'
res
<-
res
+
'\t\t\telse if (file.exists(paste0(input$results_dir,"/logs/workflow_end.error"))){\n'
res
<-
res
+
'\t\t\t\tisolate({rv$running = F})\n'
res
<-
res
+
'\t\t\t\ttoggle_inputs(reactiveValuesToList(input),T,F)\n'
res
<-
res
+
'\t\t\t\toutput$report_html = renderUI(HTML(paste(readLines(paste0(input$results_dir,"/logs/workflow_end.error"),warn=F), collapse = "<br/>")))\n'
res
<-
res
+
'\t\t\t\tfile.remove(paste0(input$results_dir,"/logs/workflow_end.error"))\n'
res
<-
res
+
'\t\t\t\tfile.remove(paste0(input$results_dir,"/logs/workflow.running"))\n'
res
<-
res
+
'\t\t\t}\n'
#res <- res + '\t\t\tshinyjs::runjs(\n'
#res <- res + '\t\t\t\t"var objDiv = document.getElementById(\'run_out\'); objDiv.scrollTop = objDiv.scrollHeight;"\n'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment