about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-01-28 10:21:34 -0800
committerKartik K. Agaram <vc@akkartik.com>2023-01-28 10:21:34 -0800
commit18f44c97617b6c4a96e10077a805d3fcdf70fba1 (patch)
tree9695453c370c2287ef692306b402c2e6616084e3
parent667f324a570406534cf2751463ebb3f78c310ce0 (diff)
downloadview.love-18f44c97617b6c4a96e10077a805d3fcdf70fba1.tar.gz
wait a little to flush disk before quitting
I've been noticing in pensieve.love in particular that once a month or
so I lose data if I quit immediately after typing in something. Nothing
major, just the odd link between notes which leaves things in an
inconsistent state. Let's see if this helps.
-rw-r--r--edit.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/edit.lua b/edit.lua
index 727f6e0..dd9b09b 100644
--- a/edit.lua
+++ b/edit.lua
@@ -192,6 +192,8 @@ function edit.quit(State)
   -- make sure to save before quitting
   if State.next_save then
     save_to_disk(State)
+    -- give some time for the OS to flush everything to disk
+    love.timer.sleep(0.1)
   end
 end
 
5'>125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156