Skip to content

Commit 3f68066

Browse files
committed
Add constant for search strings
1 parent 8a8fca2 commit 3f68066

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/recceiver/cfstore.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
__all__ = ["CFProcessor"]
2828

2929
RECCEIVERID_DEFAULT = socket.gethostname()
30+
DEFAULT_MAX_CHANNEL_NAME_QUERY_LENGTH = 600
3031

3132

3233
@dataclass
@@ -651,6 +652,8 @@ def fetch_existing_channels(
651652
) -> Dict[str, CFChannel]:
652653
"""Fetch from Channel Finder the existing channels as CFChannel given the new channel names.
653654
655+
Collects the names together to make a bunch of combined queries.
656+
654657
Args:
655658
new_channels: The new channels to fetch.
656659
client: The Channel Finder client.
@@ -667,7 +670,7 @@ def fetch_existing_channels(
667670
for channel_name in new_channels:
668671
if not searchString:
669672
searchString = channel_name
670-
elif len(searchString) + len(channel_name) < 600:
673+
elif len(searchString) + len(channel_name) < DEFAULT_MAX_CHANNEL_NAME_QUERY_LENGTH:
671674
searchString = searchString + "|" + channel_name
672675
else:
673676
searchStrings.append(searchString)

0 commit comments

Comments
 (0)