DB not synced to disk
Closed this issue · 3 comments
Not sure if this has something to do with my environment only, but I was able to fix this by modifying the code a bit (see below).
Issue is that if I delete a node it disappears from the GUI, but re-appears next time homie-ota is started. This happens even if I manually stop and re-start the service. I run it without virtualenv with separate user using systemd on RPi2 and raspbian jessie. Homie-ota latest from git.
Quick check made me feel the exit function to sync db to disk is never called (so it always restores the old data from disk on startup). I added a print there and yes, it is not called in my RPi when doing systemctl stop (SIGTERM). I'm really not a python person, but the following simple workaround made it work for me:
Thanks for reporting this, and your solution looks ok. If you care to provide a pull-request, I'll take it.
Can do that. Not a python person, so didn't know if it makes sense as is. Also didn't test it without systemd using ctrl-c.
I'll setup a PR.
Closing after merge. Thanks again.