]> git.openstreetmap.org Git - nominatim.git/commitdiff
fix off-by-one error in replication download
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 4 Feb 2021 16:04:04 +0000 (17:04 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 4 Feb 2021 16:04:04 +0000 (17:04 +0100)
nominatim/cli.py
nominatim/tools/replication.py

index e28ff29563f8edf9df2adef1a786f612520922a7..37bcaffbbb41e8bc96a99a7adccb8425ba8b2976 100644 (file)
@@ -336,7 +336,8 @@ class UpdateReplication:
             conn = connect(args.config.get_libpq_dsn())
             start = dt.datetime.now(dt.timezone.utc)
             state = replication.update(conn, params)
             conn = connect(args.config.get_libpq_dsn())
             start = dt.datetime.now(dt.timezone.utc)
             state = replication.update(conn, params)
-            status.log_status(conn, start, 'import')
+            if state is not replication.UpdateState.NO_CHANGES:
+                status.log_status(conn, start, 'import')
             batchdate, _, _ = status.get_status(conn)
             conn.close()
 
             batchdate, _, _ = status.get_status(conn)
             conn.close()
 
index c7d0d3e5d8e2621d410c8e40bbb9adee1c2b68c8..afc1af473ddb1c63bfac264ac36f1b29ba98b177 100644 (file)
@@ -101,7 +101,7 @@ def update(conn, options):
     repl = ReplicationServer(options['base_url'])
 
     outhandler = WriteHandler(str(options['import_file']))
     repl = ReplicationServer(options['base_url'])
 
     outhandler = WriteHandler(str(options['import_file']))
-    endseq = repl.apply_diffs(outhandler, startseq,
+    endseq = repl.apply_diffs(outhandler, startseq + 1,
                               max_size=options['max_diff_size'] * 1024)
     outhandler.close()
 
                               max_size=options['max_diff_size'] * 1024)
     outhandler.close()