jpasqua / VisibleTesla

Java App to monitor and Control the Tesla Model S
125 stars 41 forks source link

Lock stats files #47

Closed jpasqua closed 10 years ago

jpasqua commented 10 years ago

The code currently does not protect the stats.log and locs.log file against concurrent access from multiple copies of VisibleTesla which are both accessing the same vehicle. If multiple instances are running and each is accessing a separate vehicle, that's not a problem because each car has it's own stats and locs files.

Use the java.nio mechanism to get locks and report an error to the use at startup if the files are already locked by another instance.


This is in test as of this writing.

jpasqua commented 10 years ago

In 0.25.03. I'll close it once it is released.