From 2438dd8a0857364704c9d6088ea0272134b4f8b7 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sat, 5 Mar 2016 09:53:37 +0000 Subject: [PATCH] Disable persistent TerraSync cache for HTTP MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - 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. --- simgear/scene/tsync/terrasync.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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")); -- 2.39.5