hyperf / hyperf/socketio-server
【BUG】 socketio:clear 命令异常, 当 redis 配置了 prefix 选项后,一定会出现清除失败!
- Lingua principale
- PHP
- Stelle
- 26
- Fork
- 6
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
redis配置了前缀,并且 scan 配置了Redis::SCAN_PREFIX (其实配置不配置,都会出现问题,只要redis的options配置了前缀)
情况1:
当 scan 选项没有配置时,则scan默认为不加前缀,则调用 scan 命令获取不到keys,所以就没有清除的效果
情况2:
当 scan 选项配置为Redis::SCAN_PREFIX 时,则调用scan 命令能获取到keys, 但这些key是原始的key (添加了前缀), 则调用 del 命令会失败 (因为del也会自动添加前缀,就导致添加了两次前缀).
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Start by tracing the socketio:clear command and how its Redis scan and delete operations handle configured prefixes. Reproduce the issue with a Redis prefix, testing both the default scan behavior and Redis::SCAN_PREFIX. Done means the command finds and deletes the intended keys without applying the prefix twice.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- php, redis
- Ambito
- backend, databases
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100