From: Sarah Hoffmann Date: Sat, 8 Aug 2015 16:15:14 +0000 (+0200) Subject: respect --osm2pgsql-cache setting X-Git-Tag: v.2.5.0~36 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/5581bb67f87b3f509f396454a2a86d10f97a64a7 respect --osm2pgsql-cache setting fixes #260 --- diff --git a/utils/setup.php b/utils/setup.php index 3fad6fe8..14fe675e 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -78,11 +78,13 @@ } // Assume we can steal all the cache memory in the box (unless told otherwise) - $iCacheMemory = (isset($aCMDResult['osm2pgsql-cache'])?$aCMDResult['osm2pgsql-cache']:getCacheMemoryMB()); - if ($iCacheMemory > getTotalMemoryMB()) + if (isset($aCMDResult['osm2pgsql-cache'])) + { + $iCacheMemory = $aCMDResult['osm2pgsql-cache']; + } + else { $iCacheMemory = getCacheMemoryMB(); - echo "WARNING: resetting cache memory to $iCacheMemory\n"; } $aDSNInfo = DB::parseDSN(CONST_Database_DSN);