MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / log_request

Function log_request

chirpstack/src/stream/backend_interfaces.rs:31–52  ·  view source on GitHub ↗
(pl: stream::BackendInterfacesRequest)

Source from the content-addressed store, hash-verified

29}
30
31pub 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}

Callers 1

get_log_senderFunction · 0.70

Calls 4

redis_keyFunction · 0.85
get_async_redis_connFunction · 0.85
to_stringMethod · 0.80
getFunction · 0.50

Tested by

no test coverage detected