Commit f84b16f
committed
Extend cache-key handling to xpending_range and sort_ro
Following review, cover the other allow-listed commands that reached
execute_command without `keys`:
- xpending_range() sent XPENDING with no keys, so it raised
ValueError("Cannot create cache key.") under CSC. Pass keys=[name].
- sort_ro() delegated to sort(), which sends SORT, so SORT_RO (on the allow
list) was never cached. Send SORT_RO with keys=[key] via a private
_command argument to sort(); the write path (sort(store=...)) still sends
SORT. The SORT response callback is a no-op without `groups` (which sort_ro
never uses), so response parsing is unaffected.
Add a regression test per command in tests/test_cache.py.
(Deferred: georadius/georadiusbymember _RO caching. The GEO response
callbacks are keyed on the base command names, so sending the _RO variants
would change response parsing for withdist/withcoord/withhash calls, and the
_RO commands only exist since Redis 3.2.10. That needs _RO parser aliases and
version gating and is better handled separately.)1 parent c5b22b2 commit f84b16f
2 files changed
Lines changed: 86 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5399 | 5399 | | |
5400 | 5400 | | |
5401 | 5401 | | |
| 5402 | + | |
5402 | 5403 | | |
5403 | 5404 | | |
5404 | 5405 | | |
| |||
5459 | 5460 | | |
5460 | 5461 | | |
5461 | 5462 | | |
5462 | | - | |
| 5463 | + | |
5463 | 5464 | | |
5464 | 5465 | | |
5465 | 5466 | | |
| |||
5515 | 5516 | | |
5516 | 5517 | | |
5517 | 5518 | | |
5518 | | - | |
| 5519 | + | |
| 5520 | + | |
| 5521 | + | |
| 5522 | + | |
| 5523 | + | |
| 5524 | + | |
| 5525 | + | |
| 5526 | + | |
5519 | 5527 | | |
5520 | 5528 | | |
5521 | 5529 | | |
| |||
7796 | 7804 | | |
7797 | 7805 | | |
7798 | 7806 | | |
7799 | | - | |
| 7807 | + | |
7800 | 7808 | | |
7801 | 7809 | | |
7802 | 7810 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
197 | 272 | | |
198 | 273 | | |
199 | 274 | | |
| |||
0 commit comments