INNER CODE UNIT · Python
_auto_deregister_webhook
tomascupr/sandstorm · src/sandstorm/main.py:216
def _auto_deregister_webhook(webhook_id: str | None) -> None:
"""Deregister the auto-registered E2B webhook (best-effort cleanup)."""
if webhook_id is None:
return
try:
api_key = os.environ.get("E2B_API_KEY", "")
webhook_request("DELETE", f"/{webhook_id}", api_key)
logger.info("Deregistered E2B webhook: id=%s", webhook_id)
except Exception:
logger.warning("Failed to deregister E2B webhook id=%s", webhook_id, exc_info=True)
@asynccontextmanager
async def lifespan(app: FastAPI):
telemetry.init(app)
try:
load_api_keys()
except ValueError as e: