fix(ops): 修复 TtsQueueConsumer 中 Set/List 类型不匹配问题
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled

修复了 redisTemplate.keys() 返回 Set<String> 但代码声明为 List<String> 的类型不匹配问题

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
lzh
2026-02-01 02:26:47 +08:00
parent 0a0f6be68e
commit c6610e97f0

View File

@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
@@ -212,7 +213,7 @@ public class TtsQueueConsumer {
try {
// 获取所有队列 key
String pattern = QUEUE_KEY_PREFIX + "*";
List<String> keys = redisTemplate.keys(pattern);
Set<String> keys = redisTemplate.keys(pattern);
if (keys == null || keys.isEmpty()) {
return 0;
@@ -339,7 +340,7 @@ public class TtsQueueConsumer {
*/
public void clearAllQueues() {
String pattern = QUEUE_KEY_PREFIX + "*";
List<String> keys = redisTemplate.keys(pattern);
Set<String> keys = redisTemplate.keys(pattern);
if (keys != null && !keys.isEmpty()) {
redisTemplate.delete(keys);
deviceBroadcastLock.clear();
@@ -354,7 +355,7 @@ public class TtsQueueConsumer {
Map<String, Object> status = new ConcurrentHashMap<>();
String pattern = QUEUE_KEY_PREFIX + "*";
List<String> keys = redisTemplate.keys(pattern);
Set<String> keys = redisTemplate.keys(pattern);
if (keys != null && !keys.isEmpty()) {
for (String key : keys) {