Commit d77b99c
fix: flush ristretto buffer before cache.Del to prevent async Set race
Ristretto's Set operations are buffered asynchronously. If a prior
request's SetWithTTL is still in the buffer when Del runs, Del finds
nothing to remove, and the buffered Set then re-adds the entry —
causing the old key to remain valid.
Adding cache.Wait() before cache.Del() flushes all pending buffered
operations first, ensuring the subsequent Del actually removes the
cached entry.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 50b3311 commit d77b99c
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
| |||
0 commit comments