Save local changes (GSC/Bing integrations) before merging PR #354

This commit is contained in:
ajaysi
2026-02-13 13:11:27 +05:30
parent 43e66835ac
commit 08a1f4a1d8
144 changed files with 8310 additions and 2748 deletions

View File

@@ -88,6 +88,14 @@ def save_file_safely(
Tuple of (file_path, error_message). file_path is None on error.
"""
try:
# Handle max_file_size if it comes as string (e.g. from env vars)
if isinstance(max_file_size, str):
try:
max_file_size = int(max_file_size)
except ValueError:
# Fallback to default if conversion fails
max_file_size = 100 * 1024 * 1024
# Validate file size
if len(content) > max_file_size:
return None, f"File size {len(content)} exceeds maximum {max_file_size}"