From cc6f79b2ff4f77770a5667146f0adfaebabb60d4 Mon Sep 17 00:00:00 2001 From: fly Date: Wed, 13 Jan 2021 20:43:17 +0000 Subject: [PATCH] Make it more stable Signed-off-by: fly --- worldbuild-manager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/worldbuild-manager.py b/worldbuild-manager.py index 94b211f..01f1df6 100755 --- a/worldbuild-manager.py +++ b/worldbuild-manager.py @@ -96,6 +96,8 @@ def set_state(name, status): sid = cursor.fetchone() sql = "UPDATE tile SET status_id = " + str(sid[0]) + " WHERE parent_id = " + str(pid[0]) cursor.execute(sql) + sql = "UPDATE secondLevel SET status_id = " + str(sid[0]) + " WHERE name = '" + name + "'" + cursor.execute(sql) else: sql = "UPDATE tile SET status_id = (SELECT id FROM status WHERE name = '" + status + "') WHERE id = " + name cursor.execute(sql) @@ -114,6 +116,7 @@ try: msg = msg.decode() db.ping(reconnect=True) + db.commit() match = re.match(r"(set) ([ew]\d{3}[ns]\d{2}|[0-9]{1,7}) (done|started|rebuild|skip|pending|packaged)", msg) if match != None: