From d136d91000f3e98ce80292d909480ced4377d613 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Tue, 11 Feb 2014 10:37:41 +1100 Subject: [PATCH 1/3] 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") From 0a1fe281ca53826a793a38855ac6b87e7ccfebb4 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Tue, 11 Feb 2014 10:50:30 +1100 Subject: [PATCH 2/3] remove redundant return statement Change-Id: I09f61e61c0aa2c0ecaec04eb7541374a3265879e --- pkg/server/sync.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/server/sync.go b/pkg/server/sync.go index aba65bab9..ba11b1f7b 100644 --- a/pkg/server/sync.go +++ b/pkg/server/sync.go @@ -381,7 +381,6 @@ func (sh *SyncHandler) runSync(srcName string, enumSrc func(chan<- blob.SizedRef if err := <-errch; err != nil { sh.addErrorToLog(fmt.Errorf("replication error for source %q, enumerate from source: %v", srcName, err)) - return nCopied } return nCopied } From 64f1d810b88721bf236a4cd57b0b9931b0f97615 Mon Sep 17 00:00:00 2001 From: Aaron Boodman Date: Tue, 11 Feb 2014 06:39:30 -0800 Subject: [PATCH 3/3] Fix regression in navigation to non-image file. Before the initial click would yield an empty page, and you'd have to refresh to see anything. Change-Id: Ic26915aa26e4d9285e72ae7fa856283ee6790922 --- server/camlistored/ui/index_react.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/server/camlistored/ui/index_react.js b/server/camlistored/ui/index_react.js index 21beafd71..53f9f5e6f 100644 --- a/server/camlistored/ui/index_react.js +++ b/server/camlistored/ui/index_react.js @@ -159,6 +159,10 @@ cam.IndexPageReact = React.createClass({ } } + if (!this.isSearchMode_(newURL) && !this.isDetailMode_(newURL)) { + return false; + } + this.updateSearchSession_(newURL); this.setState({currentURL: newURL}); return true; @@ -187,7 +191,7 @@ cam.IndexPageReact = React.createClass({ }, getNav_: function() { - if (!this.inSearchMode_()) { + if (!this.isSearchMode_(this.state.currentURL)) { return null; } return cam.NavReact({key:'nav', ref:'nav', timer:this.props.timer, open:this.state.isNavOpen, onOpen:this.handleNavOpen_, onClose:this.handleNavClose_}, [ @@ -352,19 +356,19 @@ cam.IndexPageReact = React.createClass({ this.setState({selection:newSelection}); }, - inSearchMode_: function() { + isSearchMode_: function(url) { // This is super finicky. We should improve the URL scheme and give things that are different different paths. - var query = this.state.currentURL.getQueryData(); + var query = url.getQueryData(); return query.getCount() == 0 || (query.getCount() == 1 && query.containsKey('q')); }, - inDetailMode_: function() { - var query = this.state.currentURL.getQueryData(); + isDetailMode_: function(url) { + var query = url.getQueryData(); return query.containsKey('p') && query.get('newui') == '1'; }, getBlobItemContainer_: function() { - if (!this.inSearchMode_()) { + if (!this.isSearchMode_(this.state.currentURL)) { return null; } @@ -410,7 +414,7 @@ cam.IndexPageReact = React.createClass({ }, getDetailView_: function() { - if (!this.inDetailMode_()) { + if (!this.isDetailMode_(this.state.currentURL)) { return null; }