Преглед на файлове

flush to disk to prevent data loss

Daniel Sheffield преди 2 години
родител
ревизия
521720aecb
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  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")