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

Function get_log_sender

chirpstack/src/stream/backend_interfaces.rs:10–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8use chirpstack_api::stream;
9
10pub async fn get_log_sender() -> Option<Sender<stream::BackendInterfacesRequest>> {
11 let conf = config::get();
12 if conf.monitoring.backend_interfaces_log_max_history == 0 {
13 return None;
14 }
15
16 let (tx, mut rx) = mpsc::channel(100);
17
18 tokio::spawn(async move {
19 while let Some(pl) = rx.recv().await {
20 tokio::spawn(async move {
21 if let Err(e) = log_request(pl).await {
22 error!(error = %e, "Log request error");
23 }
24 });
25 }
26 });
27
28 Some(tx)
29}
30
31pub async fn log_request(pl: stream::BackendInterfacesRequest) -> Result<()> {
32 let conf = config::get();

Callers 4

setupFunction · 0.85
getFunction · 0.85
setupFunction · 0.85
getFunction · 0.85

Calls 2

log_requestFunction · 0.70
getFunction · 0.50

Tested by

no test coverage detected