MyStreamTimer icon indicating copy to clipboard operation
MyStreamTimer copied to clipboard

Changed WriteTimeToDisk to update countdown.txt indirectly

Open btipton opened this issue 5 years ago • 1 comments

Instead of writing the text directly to countdown.txt, this change instead writes to a temp file, then renames countdown.txt to another temp file, renames the original temp back to countdown.txt, and deletes the old countdown.txt. The expectation is that rename file operations are less likely to generate conflicts when the countdown file is accessed by OBS and MyStreamTimer. This is admittedly hard to test - the glitches can be a single lost second, or longer periods where the stream seems frozen for several seconds. With this change, I still see about 4 or 5 instances of a single lost second in a 5 minute timer, but this would also vary by machine. When testing, I set the Timer to 100 milliseconds, since a more frequent update interval won't generate conflicts using this code change. May help resolve issue #26

btipton avatar Jul 13 '20 15:07 btipton

Are you able to rebase off latest changes? I can give it a test.

jamesmontemagno avatar Aug 28 '20 19:08 jamesmontemagno