Browse Source

flush to disk to prevent data loss

Daniel Sheffield 2 năm trước cách đây
mục cha
commit
521720aecb
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  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")