fix: fall back to tool pods when redis is unavailable
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 2m14s
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 2m14s
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user