add devcam server -fullindex flag

Change-Id: I5ef7968d122c9a64665ab70a5f9571f6e3147836
This commit is contained in:
Andrew Gerrand 2014-02-11 10:37:41 +11:00
parent dc6b0d73e1
commit d136d91000
1 changed files with 8 additions and 1 deletions

View File

@ -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")