]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/db.php
set SQL statement timeout to php execution timeout
[nominatim.git] / lib / db.php
index b6dc89c49157ddd16072a829221f5d6193c9ef5b..d7c85e7b6df684f850c9e283bc3e2a29195689f9 100644 (file)
@@ -14,6 +14,8 @@
                $oDB->setFetchMode(DB_FETCHMODE_ASSOC);
                $oDB->query("SET DateStyle TO 'sql,european'");
                $oDB->query("SET client_encoding TO 'utf-8'");
+               $iMaxExecution = ini_get('max_execution_time') * 1000;
+               if ($iMaxExecution > 0) $oDB->query("SET statement_timeout TO $iMaxExecution");
                return $oDB;
        }