X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8332fedfd6790ed74fba981472a8885e1711fa2a..84d1e521aac266175c039712aa5a03e5701a3cfa:/utils/update.php?ds=sidebyside diff --git a/utils/update.php b/utils/update.php index ba0a5c26..069d9e72 100755 --- a/utils/update.php +++ b/utils/update.php @@ -431,9 +431,10 @@ } $iFileSize = filesize($sImportFile); $sBatchEnd = getosmosistimestamp($sOsmosisConfigDirectory); - echo "Completed for $sBatchEnd in ".round((time()-$fCMDStartTime)/60,2)." minutes\n"; $sSQL = "INSERT INTO import_osmosis_log values ('$sBatchEnd',$iFileSize,'".date('Y-m-d H:i:s',$fCMDStartTime)."','".date('Y-m-d H:i:s')."','osmosis')"; + var_Dump($sSQL); $oDB->query($sSQL); + echo "Completed for $sBatchEnd in ".round((time()-$fCMDStartTime)/60,2)." minutes\n"; } $iFileSize = filesize($sImportFile); @@ -446,12 +447,13 @@ if ($iErrorLevel) { echo "Error: $iErrorLevel\n"; - exit; + exit($iErrorLevel); } echo "Completed for $sBatchEnd in ".round((time()-$fCMDStartTime)/60,2)." minutes\n"; $sSQL = "INSERT INTO import_osmosis_log values ('$sBatchEnd',$iFileSize,'".date('Y-m-d H:i:s',$fCMDStartTime)."','".date('Y-m-d H:i:s')."','osm2pgsql')"; var_Dump($sSQL); $oDB->query($sSQL); + echo "Completed for $sBatchEnd in ".round((time()-$fCMDStartTime)/60,2)." minutes\n"; // Archive for debug? unlink($sImportFile); @@ -461,6 +463,7 @@ // Index file $sThisIndexCmd = $sCMDIndex; + $fCMDStartTime = time(); if (!$aResult['no-npi']) { @@ -469,7 +472,7 @@ if (PEAR::isError($iFileID)) { echo $iFileID->getMessage()."\n"; - exit; + exit(-1); } $sFileDir = CONST_BasePath.'/export/diff/'; $sFileDir .= str_pad(floor($iFileID/1000000), 3, '0', STR_PAD_LEFT); @@ -495,7 +498,7 @@ if ($iErrorLevel) { echo "Error: $iErrorLevel\n"; - exit; + exit($iErrorLevel); } if (!$aResult['no-npi']) @@ -510,7 +513,7 @@ if ($iErrorLevel) { echo "Error: $iErrorLevel\n"; - exit; + exit($iErrorLevel); } rename($sFileDir.'/'.str_pad($iFileID % 1000, 3, '0', STR_PAD_LEFT).".npi.out.bz2", @@ -518,9 +521,10 @@ } } - echo "Completed for $sBatchEnd in ".round((time()-$fCMDStartTime)/60,2)." minutes\n"; $sSQL = "INSERT INTO import_osmosis_log values ('$sBatchEnd',$iFileSize,'".date('Y-m-d H:i:s',$fCMDStartTime)."','".date('Y-m-d H:i:s')."','index')"; + var_Dump($sSQL); $oDB->query($sSQL); + echo "Completed for $sBatchEnd in ".round((time()-$fCMDStartTime)/60,2)." minutes\n"; $sSQL = "update import_status set lastimportdate = '$sBatchEnd'"; $oDB->query($sSQL);