Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit cache size #105

Open
giannello opened this issue Jul 29, 2016 · 6 comments
Open

Limit cache size #105

giannello opened this issue Jul 29, 2016 · 6 comments

Comments

@giannello
Copy link

For people running librespot on hardware with limited resources, it would be nice to have an option to limit the cache size.

@plietar
Copy link
Owner

plietar commented Jul 29, 2016

This is definitely something I'd like to have, but requires quite a bit of work.
At the moment, caching is just a matter of placing the file in the cache directory, and trying to open it when loading.

This requires some bookkeeping to keep track of what files are in the cache, their size, along with an eviction algorithm.

These could be used as inspiration, although librespot doesn't need something as sophisticated :
https://wiki.mozilla.org/Necko/Cache
https://www.chromium.org/developers/design-documents/network-stack/disk-cache

@mfonville
Copy link

For the moment, users that face issues with it, they could make a simple cron-job that checks the atime of files tp clean-up.

@juriansluiman
Copy link

@mfonville how is this possible? If I run find /tmp/librespot/files/* -atime +2 -exec rm {} \; it crashes librespot. The only way I can get it to work is to stop the librespot service, clear up the files and start it again. If I do this, the music will stop when playing, so it doesn't seem to be the most ideal solution yet :)

@plietar
Copy link
Owner

plietar commented Feb 22, 2017

@juriansluiman Deleting files while librespot is running should work.
Can you run librespot with RUST_BACKTRACE=1 and --verbose and post the log please ? What platform are you running on ?

@juriansluiman
Copy link

@plietar sorry, you get forget my comment. I was having another issue with librespot so it stopped working, but just tried again and it does continue to play. My bad!

@michaelherger
Copy link
Contributor

I've modified librespot to disable the audio file-cache. See pull request #181.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants