nitrojs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.build
MIT License
6.16k stars 507 forks source link

fix(cache): catch error when getting cache entry (#2609) #2820

Closed cjpearson closed 1 day ago

cjpearson commented 3 days ago

๐Ÿ”— Linked issue

2609

โ“ Type of change

๐Ÿ“š Description

This change catches possible errors on getting the cache item, following the same pattern used on setting cache items. With this change, an error when reading the cache (e.g. redis disconnect) will not cause the request to fail but will instead execute the cached function.

๐Ÿ“ Checklist