From 861e67dfe848a9d322bdb2b7b89fb669f10ae731 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Thu, 4 Feb 2021 17:04:04 +0100 Subject: [PATCH] fix off-by-one error in replication download --- nominatim/cli.py | 3 ++- nominatim/tools/replication.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nominatim/cli.py b/nominatim/cli.py index e28ff295..37bcaffb 100644 --- a/nominatim/cli.py +++ b/nominatim/cli.py @@ -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) - 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() diff --git a/nominatim/tools/replication.py b/nominatim/tools/replication.py index c7d0d3e5..afc1af47 100644 --- a/nominatim/tools/replication.py +++ b/nominatim/tools/replication.py @@ -101,7 +101,7 @@ def update(conn, options): 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() -- 2.39.5