respect --osm2pgsql-cache setting

fixes #260
This commit is contained in:
Sarah Hoffmann 2015-08-08 18:15:14 +02:00
parent 9e5c9ca81d
commit 5581bb67f8

View File

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