Skip to content

Commit

Permalink
frontend: moved pop front out of tracing scope to prevent loglevel de…
Browse files Browse the repository at this point in the history
…pendend deadlock on cdo removal of invalid commands, closes #48

Signed-off-by: aserowy <serowy@hotmail.com>
  • Loading branch information
aserowy committed Jul 5, 2024
1 parent 41e518d commit 00fb426
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions yeet-frontend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,21 +210,17 @@ fn get_command_from_stack(

let mut actions = Vec::new();
let command = if let Some(Message::NavigateToPathAsPreview(_)) = commands.front() {
while let Some(last) = commands.front() {
if let Message::NavigateToPathAsPreview(path) = last {
while let Some(front) = commands.front() {
if let Message::NavigateToPathAsPreview(path) = front {
if path.exists() {
break;
} else {
tracing::warn!(
"removing non existing cdo path: {:?}",
commands.pop_front()
);
let command = commands.pop_front();
tracing::warn!("removing non existing cdo path: {:?}", command);
}
} else {
tracing::trace!(
"removing command for non existing path: {:?}",
commands.pop_front()
);
let command = commands.pop_front();
tracing::trace!("removing command for non existing path: {:?}", command);
}
}

Expand Down

0 comments on commit 00fb426

Please sign in to comment.