import sys
import time
sys.path.append('/Eden/CORE/phi_fractal')

# Import the original
with open('eden_ULTIMATE_growth.py', 'r') as f:
    code = f.read()

# Add delay after HTTP errors
code = code.replace(
    'except Exception as e:',
    '''except Exception as e:
        if "Connection refused" in str(e) or "HTTPConnectionPool" in str(e):
            time.sleep(0.1)  # Small delay to prevent rapid cycling'''
)

# Execute modified version
exec(code)
