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

[BUG] The cache entry has not been truly deleted after expiration #2210

Closed
cyjaysong opened this issue Sep 19, 2023 · 5 comments
Closed

[BUG] The cache entry has not been truly deleted after expiration #2210

cyjaysong opened this issue Sep 19, 2023 · 5 comments

Comments

@cyjaysong
Copy link

Describe the bug
The cache entry has not been truly deleted after expiration. this will cause the program to consume more memory to store invalid data.

To Reproduce
see code in https://github.com/kataras/iris/blob/main/cache/entry/entry.go

The program logic only determines whether the expiration time has been reached. If it expires, it will be reset to the new content on the next request. If no new requests arrive, expired data will continue to occupy memory

Screenshots
image

iris.Version

  • v12.2.5
@kataras
Copy link
Owner

kataras commented Sep 25, 2023

Hello @cyjaysong, nice one, it's a chance for you to push a PR for that one! Do you want to give it a try?

@cyjaysong
Copy link
Author

@kataras I‘m willing to try

kataras added a commit that referenced this issue Sep 26, 2023
@kataras
Copy link
Owner

kataras commented Sep 26, 2023

@cyjaysong thanks, I have re-factored the code, so you can read my solution, the commit contains new features as custom max age function and custom storage, maybe your issue is solved as well, if so you don't need to do anything at all :) Check: 28f49cd

@cyjaysong
Copy link
Author

@kataras Nice, it's very useful

@kataras
Copy link
Owner

kataras commented Sep 27, 2023

You are welcome🔥💪

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

2 participants