Files
Movses Aslanyan 91afea92a1 Implement Phase 0b base project against the frozen test contract
All seven services (gateway, ledger, fraud, sanctions, insights, notifier,
audit), db/schema.sql plus optional_indexes.sql, scripts/seed.py and
smoke.py, the gateway-served frontend, and docker-compose.yml. Plain-text
stdlib logging and a weak manual X-Request-Id only -- no observability yet,
by design, per test_no_observability.py. Implements all 13 named chaos-flag
pathologies from docs/PATHOLOGIES.md behind Redis-backed runtime flags.

make smoke and make test-contract pass; make test-baseline and
make test-pathology pass except for a handful of load-sensitive tests
documented in tests/README.md rather than papered over.
2026-09-05 08:12:30 +03:30

16 lines
535 B
Python

from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine
from .settings import settings
def make_engine(**overrides):
"""A fresh async engine. Services that need more than one pool profile
(see ledger/chaos.py for pool_starvation) call this more than once."""
kwargs = dict(pool_pre_ping=True)
kwargs.update(overrides)
return create_async_engine(settings.postgres_dsn, **kwargs)
engine = make_engine(pool_size=20, max_overflow=10)
Session = async_sessionmaker(engine, expire_on_commit=False)