INNER CODE UNIT · Python

lifespan

tomascupr/sandstorm · src/sandstorm/main.py:229

async def lifespan(app: FastAPI):
    telemetry.init(app)
    try:
        load_api_keys()
    except ValueError as e:
        logger.critical("Authentication validation failed: %s", e)
        raise
    if not _WEBHOOK_SECRET:
        logger.warning(
            "SANDSTORM_WEBHOOK_SECRET not set — webhook signature verification disabled"
        )
    webhook_id = _auto_register_webhook()
    scheduler_task = await _setup_triggers(app)
    yield
    if scheduler_task is not None:
        scheduler_task.cancel()
    _auto_deregister_webhook(webhook_id)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…