mirror of
https://github.com/Djeeberjr/fw-anwesenheit.git
synced 2025-07-01 16:54:17 +00:00
pm3: id must be read twice
to avoid false reads
This commit is contained in:
parent
64299960a5
commit
fe4efdda81
@ -34,10 +34,15 @@ pub async fn run_pm3(tx: broadcast::Sender<String>) -> Result<(), Box<dyn Error>
|
|||||||
|
|
||||||
let mut reader = BufReader::new(stdout).lines();
|
let mut reader = BufReader::new(stdout).lines();
|
||||||
|
|
||||||
|
let mut last_id: String = "".to_owned();
|
||||||
|
|
||||||
while let Some(line) = reader.next_line().await? {
|
while let Some(line) = reader.next_line().await? {
|
||||||
trace!("PM3: {line}");
|
trace!("PM3: {line}");
|
||||||
if let Some(uid) = super::parser::parse_line(&line) {
|
if let Some(uid) = super::parser::parse_line(&line) {
|
||||||
tx.send(uid)?;
|
if last_id == uid {
|
||||||
|
tx.send(uid.clone())?;
|
||||||
|
}
|
||||||
|
last_id = uid.to_owned();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user