rdavydov / Twitch-Channel-Points-Miner-v2

[NEW] A simple script that will watch a stream for you and earn the channel points. A successor of Tkd-Alex's original repo.
GNU General Public License v3.0
1.21k stars 352 forks source link

securely save analytics files #316

Closed Michael1297 closed 11 months ago

Michael1297 commented 1 year ago

Is your feature request related to a problem?

Sometimes analytics files can be corrupted when written to disk.

Proposed solution

Alternatives you've considered

No response

Additional context

If the application is closed or crashes on the first step, the original file will remain untouched on the disk. And if on the second, the OS will terminate the process during the system call and rename the file.

NoxRare commented 1 year ago

I've never had any corruption issues, I've had up to 5 bots running with analytics on all of them without a single corruption issue. This really doesnt seem worth the time, have you actually encountered this issue? Even if the python script does for whatever reason crash it should not cause the analytics file to corrupt.

Michael1297 commented 1 year ago

A month ago, one of the analytics files was corrupted, but I managed to restore it. The file was very old and took up more than 10 MB on disk. Also, there have already been other cases of damage to the analytics file: https://github.com/rdavydov/Twitch-Channel-Points-Miner-v2/issues/258 https://github.com/rdavydov/Twitch-Channel-Points-Miner-v2/issues/328