fix: fall back to tool pods when redis is unavailable
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 2m14s

This commit is contained in:
jade
2026-08-10 10:29:53 +09:00
parent dd36247bf7
commit 906e7e206d
2 changed files with 48 additions and 5 deletions

View File

@@ -113,11 +113,16 @@ public class McpRouterController {
}
private List<ToolMetadata> fetchAllActiveTools() {
List<ToolMetadata> activeTools = redisRegistryService.getAllTools()
.stream()
.filter(ToolMetadata::getVisible)
.collect(Collectors.toList());
List<ToolMetadata> activeTools = new ArrayList<>();
try {
activeTools.addAll(redisRegistryService.getAllTools()
.stream()
.filter(ToolMetadata::getVisible)
.collect(Collectors.toList()));
} catch (org.springframework.data.redis.RedisConnectionFailureException exception) {
log.warn("Redis is unavailable. Fetching tools from configured fallback Tool Pods instead.");
}
Set<String> knownTools = activeTools.stream()
.map(ToolMetadata::getUid)
.collect(Collectors.toSet());