]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/lib.php
if doing structured query limit the types of osm place returned
[nominatim.git] / lib / lib.php
index 0af91e2d89a348091d8726bfc151776afb0d165a..91fe21b2c79626b23f087387a1dfb95d0c2bca16 100644 (file)
 
        function getBucketMemcache()
        {
+               static $m;
+
                if (!CONST_ConnectionBucket_MemcacheServerAddress) return null;
-               $m = new Memcached();
-               $m->addServer(CONST_ConnectionBucket_MemcacheServerAddress, CONST_ConnectionBucket_MemcacheServerPort);
+               if (!isset($m))
+               {
+                       $m = new Memcached();
+                       $m->addServer(CONST_ConnectionBucket_MemcacheServerAddress, CONST_ConnectionBucket_MemcacheServerPort);
+               }
                return $m;
        }