Spaces:
Paused
Paused
Download scripts/cleanup_ttl.py from 2Btainment/repospace: direct link, hf CLI and curl.
- Browser
- Download file 473 Bytes
-
https://huggingface.co/spaces/2Btainment/repospace/resolve/main/scripts/cleanup_ttl.py
- Command line
-
hf download hf://spaces/2Btainment/repospace/scripts/cleanup_ttl.py
-
curl -L -o cleanup_ttl.py https://huggingface.co/spaces/2Btainment/repospace/resolve/main/scripts/cleanup_ttl.py
473 Bytes
| #!/usr/bin/env python3 | |
| """Manual TTL cleanup helper (also runs inside the app loop).""" | |
| from __future__ import annotations | |
| import asyncio | |
| import sys | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| sys.path.insert(0, str(ROOT)) | |
| from backend.app.services.sessions import session_manager # noqa: E402 | |
| async def main() -> None: | |
| await session_manager.cleanup_expired() | |
| print("cleanup done") | |
| if __name__ == "__main__": | |
| asyncio.run(main()) | |