Get status; only the submitting API key can read its own request.
(request_id: str, **kwargs)
| 147 | @bp.route("/status/<request_id>", methods=["GET"]) |
| 148 | @unified_api_decorator() |
| 149 | def get_request_status(request_id: str, **kwargs) -> Tuple[Response, int]: |
| 150 | """Get status; only the submitting API key can read its own request.""" |
| 151 | try: |
| 152 | owner_key = _caller_owner_key() |
| 153 | status_info = queue_manager.get_request_status(request_id, owner_key=owner_key) |
| 154 | if status_info is None: |
| 155 | return jsonify({ |
| 156 | "status": "error", |
| 157 | "error": "Error: Request not found" |
| 158 | }), 404 |
| 159 | |
| 160 | return jsonify({ |
| 161 | "success": True, |
| 162 | "request_id": request_id, |
| 163 | **status_info |
| 164 | }), 200 |
| 165 | |
| 166 | except Exception as e: |
| 167 | logger.error(f"Error getting request status: {e}") |
| 168 | return jsonify({"status": "error", "error": str(e)}), 500 |
| 169 | |
| 170 | @bp.route("/result/<request_id>", methods=["GET"]) |
| 171 | @unified_api_decorator() |
nothing calls this directly
no test coverage detected