From d136d91000f3e98ce80292d909480ced4377d613 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Tue, 11 Feb 2014 10:37:41 +1100 Subject: [PATCH] add devcam server -fullindex flag Change-Id: I5ef7968d122c9a64665ab70a5f9571f6e3147836 --- dev/devcam/server.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dev/devcam/server.go b/dev/devcam/server.go index c29be6f9d..6f8067fbd 100644 --- a/dev/devcam/server.go +++ b/dev/devcam/server.go @@ -51,6 +51,8 @@ type serverCmd struct { throttle int latency int + fullIndexSync bool + fullClosure bool mini bool publish bool @@ -89,6 +91,8 @@ func init() { flags.IntVar(&cmd.throttle, "throttle", 150, "If -slow, this is the rate in kBps, to which we should throttle.") flags.IntVar(&cmd.latency, "latency", 90, "If -slow, this is the added latency, in ms.") + flags.BoolVar(&cmd.fullIndexSync, "fullindexsync", false, "Perform full sync to indexer on startup.") + flags.BoolVar(&cmd.fullClosure, "fullclosure", false, "Use the ondisk closure library.") flags.BoolVar(&cmd.openBrowser, "openbrowser", false, "Open the start page on startup.") @@ -175,7 +179,10 @@ func (c *serverCmd) setEnvVars() error { if user == "" { return errors.New("Could not get username from environment") } - setenv("CAMLI_FULL_INDEX_SYNC_ON_START", "false") // TODO: option to make this true + setenv("CAMLI_FULL_INDEX_SYNC_ON_START", "false") + if c.fullIndexSync { + setenv("CAMLI_FULL_INDEX_SYNC_ON_START", "true") + } setenv("CAMLI_DBNAME", "devcamli"+user) setenv("CAMLI_MYSQL_ENABLED", "false") setenv("CAMLI_MONGO_ENABLED", "false")