This commit is contained in:
Brad Fitzpatrick 2014-02-11 19:25:01 -08:00
commit 53d4f856a9
3 changed files with 19 additions and 9 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")

View File

@ -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
}

View File

@ -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;
}