]> git.openstreetmap.org Git - nominatim.git/blobdiff - utils/update.php
output date of steps during import-osmosis
[nominatim.git] / utils / update.php
index 533b48d69cec465dcdf71ad6e90da19939f8f2b1..7fa8e73c94d5be020f8b53b8ccd5799de530a719 100755 (executable)
                                                        exec($sCMDCheckReplicationLag, $aReplicationLag, $iErrorLevel); 
                                                }
                                                // There are new replication files - use osmosis to download the file
                                                        exec($sCMDCheckReplicationLag, $aReplicationLag, $iErrorLevel); 
                                                }
                                                // There are new replication files - use osmosis to download the file
-                                               echo "\nReplication Delay is ".$aReplicationLag[0]."\n";
+                                               echo "\n".date('Y-m-d H:i:s')." Replication Delay is ".$aReplicationLag[0]."\n";
                                        }
                                        $fCMDStartTime = time();
                                        echo $sCMDDownload."\n";
                                        }
                                        $fCMDStartTime = time();
                                        echo $sCMDDownload."\n";
                                        }
                                        $iFileSize = filesize($sImportFile);
                                        $sBatchEnd = getosmosistimestamp($sOsmosisConfigDirectory);
                                        }
                                        $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')";
                                        $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);
                                        $oDB->query($sSQL);
+                                       echo date('Y-m-d H:i:s')." Completed for $sBatchEnd in ".round((time()-$fCMDStartTime)/60,2)." minutes\n";
                                }
 
                                $iFileSize = filesize($sImportFile);
                                }
 
                                $iFileSize = filesize($sImportFile);
                                        echo "Error: $iErrorLevel\n";
                                        exit($iErrorLevel);
                                }
                                        echo "Error: $iErrorLevel\n";
                                        exit($iErrorLevel);
                                }
-                               echo "Completed for $sBatchEnd in ".round((time()-$fCMDStartTime)/60,2)." minutes\n";
+                               echo date('Y-m-d H:i:s')." 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);
                                $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 date('Y-m-d H:i:s')." Completed for $sBatchEnd in ".round((time()-$fCMDStartTime)/60,2)." minutes\n";
 
                                // Archive for debug?
                                unlink($sImportFile);
 
                                // Archive for debug?
                                unlink($sImportFile);
 
                        // Index file
                        $sThisIndexCmd = $sCMDIndex;
 
                        // Index file
                        $sThisIndexCmd = $sCMDIndex;
+                       $fCMDStartTime = time();
 
                        if (!$aResult['no-npi'])
                        {
 
                        if (!$aResult['no-npi'])
                        {
-                               $fCMDStartTime = time();
                                $iFileID = $oDB->getOne('select nextval(\'file\')');
                                if (PEAR::isError($iFileID))
                                {
                                $iFileID = $oDB->getOne('select nextval(\'file\')');
                                if (PEAR::isError($iFileID))
                                {
                                }
                        }
 
                                }
                        }
 
-                       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')";
                        $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);
                        $oDB->query($sSQL);
+                       echo date('Y-m-d H:i:s')." Completed for $sBatchEnd in ".round((time()-$fCMDStartTime)/60,2)." minutes\n";
 
                        $sSQL = "update import_status set lastimportdate = '$sBatchEnd'";
                        $oDB->query($sSQL);
 
                        $fDuration = time() - $fStartTime;
 
                        $sSQL = "update import_status set lastimportdate = '$sBatchEnd'";
                        $oDB->query($sSQL);
 
                        $fDuration = time() - $fStartTime;
-                       echo "Completed for $sBatchEnd in ".round($fDuration/60,2)."\n";
+                       echo date('Y-m-d H:i:s')." Completed for $sBatchEnd in ".round($fDuration/60,2)."\n";
                        if (!$aResult['import-osmosis-all']) exit;
 
                        if ( CONST_Replication_Update_Interval > 60 )
                        if (!$aResult['import-osmosis-all']) exit;
 
                        if ( CONST_Replication_Update_Interval > 60 )
                        {
                                $iSleep = max(0,CONST_Replication_Update_Interval-$fDuration);
                        }
                        {
                                $iSleep = max(0,CONST_Replication_Update_Interval-$fDuration);
                        }
-                       echo "Sleeping $iSleep seconds\n";
+                       echo date('Y-m-d H:i:s')." Sleeping $iSleep seconds\n";
                        sleep($iSleep);
                }
 
                        sleep($iSleep);
                }