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

How to restrict the space used by cache? #41

Open
ritikkanotra opened this issue Oct 29, 2020 · 2 comments
Open

How to restrict the space used by cache? #41

ritikkanotra opened this issue Oct 29, 2020 · 2 comments

Comments

@ritikkanotra
Copy link

First of all, kudos to you and thanks for creating such library. It is very helpful.

How to restrict the space used by cache? For eg. - after 100MB is reached, the old files should automatically get deleted to make space for new files, restricting the space used by cache to 100MB.

@huxq17
Copy link
Owner

huxq17 commented Oct 29, 2020

Sorry, the library haven't such a function,but you can do it by yourself by adding a downloadInterceptor. refer to https://github.com/huxq17/Pump/blob/master/app/src/main/java/com/huxq17/download/demo/DemoApplication.java .by the way, downloadInterceptor is running at work thread. you can use that to hook download stream.

@ritikkanotra
Copy link
Author

Okh. Thanks.

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

No branches or pull requests

2 participants