From: James Turner Date: Sat, 5 Mar 2016 09:53:37 +0000 (+0000) Subject: Disable persistent TerraSync cache for HTTP X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2438dd8a0857364704c9d6088ea0272134b4f8b7;p=simgear.git Disable persistent TerraSync cache for HTTP - since the root-level request for an HTTP repo is small, and static, it doesn’t make sense to use the same persistent cache, especially for initial testing. --- diff --git a/simgear/scene/tsync/terrasync.cxx b/simgear/scene/tsync/terrasync.cxx index a44bbe30..6385b484 100644 --- a/simgear/scene/tsync/terrasync.cxx +++ b/simgear/scene/tsync/terrasync.cxx @@ -927,13 +927,21 @@ void SGTerraSync::reinit() if (_terraRoot->getBoolValue("enabled",false)) { _svnThread->setSvnServer(_terraRoot->getStringValue("svn-server","")); - _svnThread->setHTTPServer(_terraRoot->getStringValue("http-server","")); + std::string httpServer(_terraRoot->getStringValue("http-server","")); + _svnThread->setHTTPServer(httpServer); _svnThread->setSvnDataServer(_terraRoot->getStringValue("svn-data-server","")); _svnThread->setRsyncServer(_terraRoot->getStringValue("rsync-server","")); _svnThread->setLocalDir(_terraRoot->getStringValue("scenery-dir","")); _svnThread->setAllowedErrorCount(_terraRoot->getIntValue("max-errors",5)); _svnThread->setUseBuiltin(_terraRoot->getBoolValue("use-built-in-svn",true)); - _svnThread->setCachePath(SGPath(_terraRoot->getStringValue("cache-path",""))); + + if (httpServer.empty()) { + // HTTP doesn't benefit from using the persistent cache + _svnThread->setCachePath(SGPath(_terraRoot->getStringValue("cache-path",""))); + } else { + SG_LOG(SG_TERRASYNC, SG_INFO, "HTTP repository selected, disabling persistent cache"); + } + _svnThread->setCacheHits(_terraRoot->getIntValue("cache-hit", 0)); _svnThread->setUseSvn(_terraRoot->getBoolValue("use-svn",true)); _svnThread->setExtSvnUtility(_terraRoot->getStringValue("ext-svn-utility","svn"));