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 clean the cache #12

Open
chaos369 opened this issue Dec 15, 2020 · 6 comments
Open

How to clean the cache #12

chaos369 opened this issue Dec 15, 2020 · 6 comments

Comments

@chaos369
Copy link

Hi, Are there any way to clean the cache routinely or gracefully?

@WinPooh32
Copy link
Owner

No, cache controlling is not implemented yet.
But you can try my similar project (only json output, http api is described here), which can handle cache.

@chaos369
Copy link
Author

Thanks for your reply sir, are there any documents about WinPooh32/content? Have you done performance testing for either of them? Wish you can adding the cache cleaning to peerstohttp.

@WinPooh32
Copy link
Owner

openapi.yaml is api specification :)
You can render docs using it. Copy&paste it's content to https://editor.swagger.io/
Or generate client's code using https://openapi-generator.tech/

Settings api is not implemented yet.

Performance is same as for peerstohttp. Also same commands for compiling, but only from /cmd/service directory.

Yep, I am going to add cache to peerstohttp.

@chaos369
Copy link
Author

Thank you for your great work sir, I'm trying more.

@WinPooh32
Copy link
Owner

I have been added -cache-capacity option, by default it's limited to 10 GiB.
Can be set to -1 for disabling cache capacity size limit.

@omgbox
Copy link

omgbox commented Feb 12, 2023

you could use bash script

nano /usr/bin/remove.sh

chmod u+x /usr/bin/remove.sh

#!/bin/bash
find /tmp/ -maxdepth 1 -cmin +120 -name "*" -exec /bin/rm -f {} \;

crontab -e use nano editor

*/45 * * * * /usr/bin/remove.sh

this will automatically start /usr/bin/remove.sh every 45 minutes and the bash script will check which files are older than 120 minutes and delete them.

just another way to remove tmp files

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

3 participants