From 386ffce1c5b246dd3acd02c08e98e34ba3bf9674 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 13 Jan 2021 14:23:34 +0100 Subject: [PATCH] calcglobalstats: Add missing MySQL commit The commit was missing after the MySQL queries, leaving e.g. updated V2 Hoods unchanged in the database. Add commit for individual function and for the script to be sure nothing else is overlooked. Signed-off-by: Adrian Schmutzler --- ffmap/hoodtools.py | 2 ++ scripts/calcglobalstats.py | 1 + 2 files changed, 3 insertions(+) diff --git a/ffmap/hoodtools.py b/ffmap/hoodtools.py index 31bb76d..89ea2ad 100644 --- a/ffmap/hoodtools.py +++ b/ffmap/hoodtools.py @@ -37,6 +37,8 @@ def update_hoods_v2(mysql): lng=VALUES(lng) """,kx_data) + mysql.commit() + except urllib.error.HTTPError as e: return diff --git a/scripts/calcglobalstats.py b/scripts/calcglobalstats.py index e7f1c5e..7dc0cd0 100755 --- a/scripts/calcglobalstats.py +++ b/scripts/calcglobalstats.py @@ -26,6 +26,7 @@ record_global_stats(influ,mysql) record_hood_stats(influ,mysql) record_gw_stats(influ,mysql) update_mapnik_csv(mysql) +mysql.commit() mysql.close() print("--- %.3f seconds ---" % (time.time() - start_time))