openpilot
openpilot copied to clipboard
laikad: don't write cache to disk
Laikad caches file to disk but doesn't clean up after itself. This happens to be mostly ok right now because it writes to a tmpfs which doesn't persist across boots. Laika should provide provide a function that returns whether a given file is relevant.
Do you mean the files downloaded in Laika or the parsed orbits/nav data cached in Laikad? The latter is overwritten when new files arrive so that shouldn't be a problem. I think all files downloaded in Laika can be removed safely after 48 hours. (I think the prediction files contain data not longer than 48 hours). And most could actually be removed directly after being parsed since Laikad has its own cache. (except for the .attempt files to avoid many download requests)
@gast04 I think what we want to do here is refactor laika to not write to disk at all in our case, but it doesn't seem like that refactor will make it for 0.9.1. What do you think about just periodically cleaning the cache in laikad? Do we ever read it?
Ah, I see we're always running in no internet mode. Removing from the milestone.
Irrelevant until internet is enabled.