Setup queue mode with native v2 and synchronous v1 compatibility endpoints.
(app: Flask)
| 17 | from ..decorators.security import limiter |
| 18 | |
| 19 | def _setup_queue_mode(app: Flask) -> None: |
| 20 | """Setup queue mode with native v2 and synchronous v1 compatibility endpoints.""" |
| 21 | from ..core.request_queue import queue_manager |
| 22 | queue_manager.start() |
| 23 | |
| 24 | command_bp = create_command_blueprint() |
| 25 | app.register_blueprint(command_bp, url_prefix='/api/v2') |
| 26 | |
| 27 | legacy_bp = create_legacy_command_blueprint(use_queue=True) |
| 28 | app.register_blueprint(legacy_bp, url_prefix='/api/v1') |
| 29 | |
| 30 | # Register onboarding endpoints |
| 31 | onboarding_bp = create_onboarding_blueprint() |
| 32 | app.register_blueprint(onboarding_bp, url_prefix='/api/v2') |
| 33 | |
| 34 | logger.debug("Started queue manager and registered /api/v2 plus synchronous /api/v1 compatibility endpoints") |
| 35 | |
| 36 | def _setup_legacy_mode(app: Flask) -> None: |
| 37 | """Setup legacy mode with v1 API endpoints.""" |
no test coverage detected