somakeit / door-controller2

A new door controller for a new space, where all the previous hardware is broken and we can't replace it.
1 stars 0 forks source link

server poll can clear unsent data from local cache. #13

Closed brackendawson closed 8 years ago

brackendawson commented 8 years ago

https://github.com/somakeit/door-controller2/blob/master/doord.py#L504 clears the local unsent data on an asynchronous Process, it can erase data that was not in the POST.

Need the asynchronous Process to work with a copy of the dict and put it back with changes on top of the local copy on failure. The vivify function can't handle this, it should be removed and all the databse setters check keys exist the slow way.

brackendawson commented 8 years ago

I can actually lock the database when adding auths & scans, and when initting a tag, and when copying unsent to send.

I can keep a simple list of unsent objects to re-play so I don't need to smash failed posts back into unsent.