From bf4bdd2fa896aefbd5c0c5be7dc5dd7a096e0ad5 Mon Sep 17 00:00:00 2001 From: ManuelW Date: Sat, 11 May 2024 11:23:14 +0200 Subject: [PATCH] DB config --- insertLoading.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/insertLoading.py b/insertLoading.py index a4ea507..980b413 100644 --- a/insertLoading.py +++ b/insertLoading.py @@ -46,7 +46,10 @@ def updateLast(db, cursor): cursor.execute(sql) row = cursor.fetchone() - if row[0]: + if not row[0]: + insertNew(db, cursor) + + else: ins_id = row[0] ## hole alle Fahrten nach letzter Ladung @@ -63,9 +66,7 @@ def updateLast(db, cursor): print("Anzahl:", len(rows)) if len(rows) < 1: - insertNew(db, cursor) print("Keine neuen Daten vorhanden, beende jetzt.") - cursor.close() if db: db.close() print("The SQLite connection is closed")