Felipe Gomes schrieb:
What prompted the question is that I'm working on a conversion from SQLite 
storage to a JSON file. OS.File.writeAtomic provides a good guarantee of data 
consistency against crashes etc, and I'm now looking how to guarantee a proper 
full flush of the data to disk during shutdown.

Just make sure you do (lazily but still) also flush that data out to disk every now and then during normal operation. For one thing, people leave Firefox running for hours, days and even weeks and if they run into a crash, they shouldn't lose state over such long periods, and for the other, we want shutdown to be fast and the ideal situation is that you already have written everything when the shutdown request comes and you don't need to care. ;-)

Robert Kaiser

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to