vtex / node-vtex-api

VTEX IO API Client for Node
76 stars 16 forks source link

Simplifies logic of LRUDiskCache #527

Open danzanzini opened 1 year ago

danzanzini commented 1 year ago

What is the purpose of this pull request?

This PR changes the LRUDiskCache implementations to use the dispose function of the LRU implementation to clear the disk cache instead of implementing it on get and set functions.

What problem is this solving?

After adding some LRUDiskCache to our code, we saw that its metrics were not working correctly. By checking the implementation, I suspect that when any key needs to be removed from the cache, none of the keys will be retrieved due to this logic. The key to be deleted is not being verified before removal.

How should this be manually tested?

I think the only way to test this properly is installing it in some accounts and check the behavior.

Types of changes