Skip to content

tdfs4ds.serve.config_checks

tdfs4ds.serve.config_checks

The configuration check, kept for the admin app (0.3.7.4).

diagnostics.check_configuration is the authority; this module decides when it runs in the app and keeps its last answers so the rest of the app (the capabilities, the status bar) can read them without running anything:

  • after a successful connect (startup, the Connect page, a store switch): the checks that need the database session run at once on the calling thread (DATABASE_CHECKS: they use teradataml's shared connection, so they never run in the background), and the others run as one background job (they make network calls: the model, the Vector Store, MCP);
  • every TDFS4DS_SERVE_CONFIG_CHECK_HOURS hours (default 6, 0 = off): only the checks that make no model call (PERIODIC_CHECKS), and only when no other background job runs, so a check never competes with a documentation run;
  • on demand: the Parameters card; whatever it ran updates the cache.

The cache is {name: row}, each row stamped with ran_at -- a run of a subset keeps the rows it did not run.

logger module-attribute

logger = logging.getLogger(__name__)

DATABASE_CHECKS module-attribute

DATABASE_CHECKS = ('database_temporal', 'database_query_band', 'database_time_zone')

PERIODIC_CHECKS module-attribute

PERIODIC_CHECKS = ('config_loaded', 'vector_store_auth', 'vector_store_service', 'tracing')

DEFAULT_HOURS module-attribute

DEFAULT_HOURS = 6.0

JOB_KEY module-attribute

JOB_KEY = 'config-check'

_LOCK module-attribute

_LOCK = threading.RLock()

_CACHE module-attribute

_CACHE: dict = {'ran_at': None, 'live': None, 'checks': {}, 'scope': ''}

_LAST_PERIODIC module-attribute

_LAST_PERIODIC = [0.0]

reset

reset() -> None

hours

hours() -> float

_now_iso

_now_iso() -> str

record

record(report: dict, scope: str = '') -> None

Merge a report's rows into the cache (a subset run keeps the other rows).

cached_checks

cached_checks() -> dict

{name: row} of the last answers (a copy).

summary

summary() -> dict

What the status bar shows: when, how many problems, which.

_running

_running() -> bool

_run

_run(only=None, exclude=None, scope='') -> Optional[dict]

run_database_checks

run_database_checks() -> Optional[dict]

The checks that use the database session, now, on this thread.

run_background_checks

run_background_checks() -> str

Everything that does not use the session, as one background job.

on_connected

on_connected() -> None

After a successful connect: the session checks now, the rest in the background.

maybe_run_periodic

maybe_run_periodic(now: Optional[float] = None) -> bool

Run the cheap subset when it is due and nothing else is running. True if started.