Browse Source

flush to disk to prevent data loss

Daniel Sheffield 2 years ago
parent
commit
521720aecb
1 changed files with 1 additions and 0 deletions
  1. 1 0
      grocery_transactions.py

+ 1 - 0
grocery_transactions.py

@@ -174,6 +174,7 @@ class GroceryTransactionEditor(urwid.WidgetPlaceholder):
             f"$descr${description}$descr$, {quantity}, $unit${unit}$unit$, " \
             f"{price}, $produ${product}$produ$, {organic});\n"
         self.log.write(statement)
+        self.log.flush()
         self.cur.execute(statement)
 
 cur.execute("BEGIN")