Permalink
Browse files

add init.R hook and use uuid package for UUIDs

  • Loading branch information...
1 parent 51b0c25 commit 7c7496355ff6e4bae1b0914928882d128d632b50 @s-u s-u committed Feb 25, 2013
Showing with 7 additions and 2 deletions.
  1. +1 −0 rcloud.support/DESCRIPTION
  2. +5 −0 rcloud.support/R/rcloud.support.R
  3. +1 −2 rcloud.support/R/uuid.R
@@ -4,4 +4,5 @@ Version: 1.0-0
Author: Carlos Scheidegger <cscheid@research.att.com>, Simon Urbanek <urbanek@research.att.com>
Maintainer: Carlos Scheidegger <cscheid@research.att.com>
Description: It's used by RCloud internally.
+Imports: uuid
License: EPL
@@ -191,6 +191,11 @@ start.rcloud <- function(username="", ...) {
## generate per-session result UUID (optional, really)
.session$result.prefix.uuid <- generate.uuid()
+ ## last-minute updates (or custom initialization) to be loaded
+ ## NB: it should be really fast since it will cause connect delay
+ if (file.exists(fn <- file.path(.rc.conf$configuration.root, "init.R")))
+ source(fn, TRUE)
+
## per-user setup
if (nzchar(.session$username)) {
.session$username <- gsub("[^a-zA-Z0-9_.]+", "_", .session$username)
@@ -3,8 +3,7 @@
.result.hash <- new.env(hash=TRUE, parent=emptyenv())
-# FIXME should use libuuid directly
-generate.uuid <- function() system("uuidgen", intern=TRUE);
+generate.uuid <- function() uuid::UUIDgenerate()
stash.result <- function(value) {
new.hash <- generate.uuid()

0 comments on commit 7c74963

Please sign in to comment.