jifunks / botany

command line virtual plant buddy
ISC License
438 stars 32 forks source link

save_plant: inelegant concurrency fix #38

Open marado opened 3 years ago

marado commented 3 years ago

This inelegant and hackyish fix gives a randomly generated name to the temporary savefiles, so there is only a 0.1% chance of the filename being the same twice in a row.

This solves the ocasional exceptions raised in save_plant, when there is more than one call still running at once, for the same user (due to slow writes).