MikeBishop / MMM-Powerwall

MagicMirror2 module for Tesla Powerwall and TWCManager
MIT License
22 stars 4 forks source link

Race conditions in Owner API queries #59

Closed MikeBishop closed 3 years ago

MikeBishop commented 3 years ago

The setup of the timers is intended to reduce the odds that multiple clients will request the same data simultaneously. However, it appears to happen often enough that one will request the data in the period between receiving a request and replying with the event. If a request is already in progress, we should drop it while we wait for the first one to finish.

(Obviously with a reasonable timeout, so we don't forever stop making requests when something stalls.)