Files
WebApi/webapi/orquestacion/conexion.py
T
Roberto Treviño Cervantes ae1ee4633f absorb Orquestacion into webapi.orquestacion
Orquestacion was a separate uv package with exactly one consumer
(webapi.indicadores_vivos) and no independent deployment: the Dockerfile
already copied it straight into this image and ran one uv sync for
everything. Folding it in removes a redundant pyproject.toml/uv.lock/venv
without losing the standalone CLI (python -m webapi.orquestacion ciclo/
confirmar-riesgos) or its test suite, which now runs as part of this
project's own pytest run.

417 tests pass (416 unchanged + the merged orquestacion suite); verified
live in a built image, where the indicadores worker completed a full
cacu/cama/tea cycle against webapi.orquestacion.ejecutor.
2026-10-31 00:51:41 -06:00

19 lines
618 B
Python

"""Apuntar Persistance a la base de un proyecto. Es lo que hace `<PROYECTO>_DATABASE_URL`.
Persistance lee su configuración al importarse; para cambiar de base en el
mismo proceso (pruebas, dev-data) se cambia el ajuste en memoria y se limpia la
caché del motor. Igual que `dev_data.ingesta.apuntar`.
"""
from persistance.settings import settings
from persistance import db
def apuntar(proyecto: str, url: str) -> None:
motor = getattr(db, f"get_{proyecto}_engine")
if motor.cache_info().currsize:
motor().dispose()
setattr(settings, f"{proyecto}_database_url", url)
motor.cache_clear()