(pl: stream::BackendInterfacesRequest)
| 29 | } |
| 30 | |
| 31 | pub async fn log_request(pl: stream::BackendInterfacesRequest) -> Result<()> { |
| 32 | let conf = config::get(); |
| 33 | |
| 34 | if conf.monitoring.backend_interfaces_log_max_history == 0 { |
| 35 | return Ok(()); |
| 36 | } |
| 37 | |
| 38 | let key = redis_key("backend_interfaces:stream:request".to_string()); |
| 39 | let b = pl.encode_to_vec(); |
| 40 | () = redis::cmd("XADD") |
| 41 | .arg(&key) |
| 42 | .arg("MAXLEN") |
| 43 | .arg("~") |
| 44 | .arg(conf.monitoring.backend_interfaces_log_max_history) |
| 45 | .arg("*") |
| 46 | .arg("request") |
| 47 | .arg(&b) |
| 48 | .query_async(&mut get_async_redis_conn().await?) |
| 49 | .await?; |
| 50 | |
| 51 | Ok(()) |
| 52 | } |
no test coverage detected