]> git.mxchange.org Git - simgear.git/commitdiff
Disable persistent TerraSync cache for HTTP
authorJames Turner <zakalawe@mac.com>
Sat, 5 Mar 2016 09:53:37 +0000 (09:53 +0000)
committerJames Turner <zakalawe@mac.com>
Sat, 5 Mar 2016 09:53:37 +0000 (09:53 +0000)
- 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

index a44bbe30610f52817434d916083e958a4d699c17..6385b484d591bba88fe87e4db01f2a18f82557ba 100644 (file)
@@ -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"));