Revision 2bf4b7346eb13ff77a90b84e177d83f94f2377d9 authored by petrovich on 29 January 2019, 16:29:30 UTC, committed by Vladislav Kamenev on 04 February 2019, 16:04:05 UTC
1 parent 34b4118
loadSession.R
sessionExists <- function(sessionName) {
ocpuRoot <- strsplit(getwd(), 'ocpu-temp')[[1]][1]
sessionPath <- paste(ocpuRoot, 'ocpu-store', sessionName, sep=.Platform$file.sep)
RDataPath <- paste(sessionPath, '.RData', sep=.Platform$file.sep)
if (file.exists(RDataPath)) {
savedEnv <- load(RDataPath)
return (jsonlite::toJSON(list(result="es" %in% savedEnv), auto_unbox = TRUE))
}
return (jsonlite::toJSON(list(result=FALSE), auto_unbox = TRUE))
}
loadSesssion <- function (sessionName) {
ocpuRoot <- strsplit(getwd(), 'ocpu-temp')[[1]][1]
sessionPath <- paste(ocpuRoot, 'ocpu-store', sessionName, sep=.Platform$file.sep)
RDataPath <- paste(sessionPath, '.RData', sep=.Platform$file.sep)
if (file.exists(RDataPath)) {
savedEnv <- load(RDataPath)
if (!("es" %in% savedEnv)) {
return (jsonlite::toJSON(NULL))
}
result <- list(es=writeToList(es))
f <- tempfile(pattern = "gse", tmpdir = getwd(), fileext = ".bin")
writeBin(protolite::serialize_pb(result), f)
return (jsonlite::toJSON(basename(f)))
}
return(jsonlite::toJSON(NULL))
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...