fix(ops): 修复 TtsQueueConsumer 中 Set/List 类型不匹配问题
修复了 redisTemplate.keys() 返回 Set<String> 但代码声明为 List<String> 的类型不匹配问题 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user