Commit 6441b57
fix(cache): fix ttl cache update method (JhaSourav07#2196)
## Summary
Fixes an issue where `TTLCache.update()` returned `false` for expired
entries but did not remove them from the internal cache store.
## Changes Made
* Added immediate cleanup of expired entries inside `update()`.
* Deletes the expired key from `this.store` before returning `false`.
* Keeps behavior consistent with `get()` and `has()`, which already
remove expired entries when encountered.
## Expected Result
Expired cache entries are no longer left in memory after calling
`update()`, reducing stale data retention and ensuring consistent cache
behavior.
Fixes JhaSourav07#18791 parent 14653fc commit 6441b57
1 file changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
151 | 149 | | |
152 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
| |||
0 commit comments