]> git.openstreetmap.org Git - nominatim.git/blobdiff - utils/update.php
updates: always remove output file and start with correct sequence id
[nominatim.git] / utils / update.php
index a1b5e54cab8116713745285a49328b831c9c0683..2b72fe821e0e390fa9ea5f5690758d8ec6aaa63f 100755 (executable)
@@ -262,12 +262,12 @@ if ($aResult['import-osmosis'] || $aResult['import-osmosis-all']) {
             }
 
             // Download the next batch of changes.
-            unlink($sImportFile);
             do {
                 $fCMDStartTime = time();
-                $iNextSeq = (int) $aLastState['sequence_id'] + 1;
+                $iNextSeq = (int) $aLastState['sequence_id'];
                 unset($aOutput);
                 echo "$sCMDDownload -I $iNextSeq\n";
+                unlink($sImportFile);
                 exec($sCMDDownload.' -I '.$iNextSeq, $aOutput, $iResult);
 
                 if ($iResult == 3) {