Skip to content

Commit 0711ff3

Browse files
Robbie1977Copilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent b9b6eef commit 0711ff3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/vfbquery/solr_result_cache.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,12 @@ def __init__(self,
125125
self.cache_url = cache_url
126126
self.ttl_hours = ttl_hours
127127
if max_result_size_mb is None:
128-
max_result_size_mb = int(os.getenv('VFBQUERY_MAX_RESULT_MB', '100'))
128+
raw = os.getenv("VFBQUERY_MAX_RESULT_MB", "100")
129+
try:
130+
max_result_size_mb = int(raw)
131+
except ValueError:
132+
logger.warning("Invalid VFBQUERY_MAX_RESULT_MB=%r; falling back to 100", raw)
133+
max_result_size_mb = 100
129134
self.max_result_size_mb = max_result_size_mb
130135
# The cap is enforced on the COMPRESSED (gzip+base64) payload that is
131136
# actually stored, so 100 MB here corresponds to ~1-1.5 GB of raw JSON.

0 commit comments

Comments
 (0)