Skip to content

Commit 012aae6

Browse files
committed
Add constant for search strings
1 parent e15f0da commit 012aae6

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
@@ -650,6 +651,8 @@ def fetch_existing_channels(
650651
) -> Dict[str, CFChannel]:
651652
"""Fetch from Channel Finder the existing channels as CFChannel given the new channel names.
652653
654+
Collects the names together to make a bunch of combined queries.
655+
653656
Args:
654657
new_channels: The new channels to fetch.
655658
client: The Channel Finder client.
@@ -666,7 +669,7 @@ def fetch_existing_channels(
666669
for channel_name in new_channels:
667670
if not searchString:
668671
searchString = channel_name
669-
elif len(searchString) + len(channel_name) < 600:
672+
elif len(searchString) + len(channel_name) < DEFAULT_MAX_CHANNEL_NAME_QUERY_LENGTH:
670673
searchString = searchString + "|" + channel_name
671674
else:
672675
searchStrings.append(searchString)

0 commit comments

Comments
 (0)