Skip to content

Commit

Permalink
fix(strategy): where did commit f25b84f go
Browse files Browse the repository at this point in the history
  • Loading branch information
ooliver1 committed Aug 30, 2023
1 parent 35fbc8c commit 89204ac
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mafic/strategy.py
Expand Up @@ -11,6 +11,7 @@
from typing import List, Optional

from .node import Node
from .region import VoiceRegion
from .type_variables import ClientT

StrategyCallable = Callable[
Expand Down Expand Up @@ -107,6 +108,17 @@ def location_strategy(
)
return nodes

try:
voice_region = VoiceRegion(voice_region)
except ValueError:
_log.error(
"Failed to match endpoint %s (match: %s) to a region, "
"defaulting to all nodes.",
endpoint,
voice_region,
)
return nodes

regional_nodes = list(
filter(
lambda node: node.regions is not None and voice_region in node.regions,
Expand Down

0 comments on commit 89204ac

Please sign in to comment.