"""Force SQLAlchemy pool sizing for a pool-comparison run. WHY this exists: shopdb/config.py does not read pool size from the environment, so a test container cannot be pointed at a different pool without a code change. This patches Config.SQLALCHEMY_ENGINE_OPTIONS at import time, before create_app builds the engine, purely so a bigger pool can be MEASURED before deciding whether to make it permanent. Not for production use. Mounted into a throwaway container as sitecustomize.py, which Python imports automatically at startup. """ import os from shopdb.config import Config _size = int(os.environ.get('FORCE_POOL_SIZE', '5')) _overflow = int(os.environ.get('FORCE_MAX_OVERFLOW', '10')) _options = dict(Config.SQLALCHEMY_ENGINE_OPTIONS) _options['pool_size'] = _size _options['max_overflow'] = _overflow Config.SQLALCHEMY_ENGINE_OPTIONS = _options