(
State(state): State<AppState>,
Query(query): Query<InspectorPollQuery>,
)
| 1659 | } |
| 1660 | |
| 1661 | async fn inspector_poll( |
| 1662 | State(state): State<AppState>, |
| 1663 | Query(query): Query<InspectorPollQuery>, |
| 1664 | ) -> Result<Response, AppError> { |
| 1665 | if query.process_identifier <= 0 { |
| 1666 | return Err(AppError::bad_request( |
| 1667 | "`processIdentifier` must be a positive process id.", |
| 1668 | )); |
| 1669 | } |
| 1670 | state |
| 1671 | .inspectors |
| 1672 | .ensure_polled_agent(query.process_identifier) |
| 1673 | .await |
| 1674 | .map_err(AppError::native)?; |
| 1675 | match state |
| 1676 | .inspectors |
| 1677 | .poll(query.process_identifier, Duration::from_secs(25)) |
| 1678 | .await |
| 1679 | .map_err(AppError::native)? |
| 1680 | { |
| 1681 | Some(request) => Ok(Json(request).into_response()), |
| 1682 | None => Ok(StatusCode::NO_CONTENT.into_response()), |
| 1683 | } |
| 1684 | } |
| 1685 | |
| 1686 | async fn inspector_direct_request( |
| 1687 | State(state): State<AppState>, |
nothing calls this directly
no test coverage detected