mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-15 19:07:58 +00:00
Guard against network failures in getDatabaseDate()
When updating use the date from the diff file instead as we are guaranteed to get this if the file has been successfully loaded.
This commit is contained in:
@@ -407,9 +407,13 @@ if ($aCMDResult['load-data'] || $aCMDResult['all']) {
|
||||
|
||||
$sDatabaseDate = getDatabaseDate($oDB);
|
||||
pg_query($oDB->connection, 'TRUNCATE import_status');
|
||||
$sSQL = "INSERT INTO import_status (lastimportdate) VALUES('".$sDatabaseDate."')";
|
||||
pg_query($oDB->connection, $sSQL);
|
||||
echo "Latest data imported from $sDatabaseDate.\n";
|
||||
if ($sDatabaseDate === false) {
|
||||
echo "WARNING: could not determine database date.\n";
|
||||
} else {
|
||||
$sSQL = "INSERT INTO import_status (lastimportdate) VALUES('".$sDatabaseDate."')";
|
||||
pg_query($oDB->connection, $sSQL);
|
||||
echo "Latest data imported from $sDatabaseDate.\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ($aCMDResult['import-tiger-data']) {
|
||||
|
||||
Reference in New Issue
Block a user