smarthome
smarthome copied to clipboard
Feature request: Delete 0 byte cache files in Admin Interface
I just came across the issue of running out of disk space. Some cache files are now f** up, meaning they have 0 bytes. On startup I get this message:
Problem reading cache: Ran out of input
So far so good. Deleted those files manually and system is up and running without warnings. However, it would be cool to extend the cache check in the admin interface to find 0 byte files and delete them on demand.
Hm. Why not simply delete 0 byte cache files regardless of the admin interface? I mean having 0 byte cache files is pure nonsense...?
Yeah that would actually be the better strategy. On startup 0 bytes cache files could be deleted automatically..?
@onkelandy Are you going to implement this and give a PR?
Will try that soon, yeah. Think I will change line 417 here https://github.com/smarthomeNG/smarthome/blob/master/lib/item/item.py
and check if os.stat(self._cache).st_size == 0 -> delete file. Gotta make sure it works on all OSes though.
With the next change of the item's value the cache file should have the new value written to it. Or are the values of the items with the broken cache file changed only seldom?
Deletion of 0 byte cache files implemented with commit 419de34
SmartHomeNG v1.9.4 has been released