Skip to content

Commit

Permalink
fix: repeat retry screen instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
manueldeprada committed Oct 15, 2024
1 parent 240a53a commit a56dacb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion zellij-server/src/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ use crate::{
screen::ScreenInstruction,
ServerInstruction, SessionMetaData, SessionState,
};
use std::thread;
use std::time::Duration;
use uuid::Uuid;
use zellij_utils::{
channels::SenderWithContext,
Expand Down Expand Up @@ -1218,13 +1220,18 @@ pub(crate) fn route_thread_main(
}
Ok(should_break)
};
let mut repeat_retries = VecDeque::new();
while let Some(instruction_to_retry) = retry_queue.pop_front() {
log::warn!("Server ready, retrying sending instruction.");
let should_break = handle_instruction(instruction_to_retry, None)?;
thread::sleep(Duration::from_millis(5));
let should_break =
handle_instruction(instruction_to_retry, Some(&mut repeat_retries))?;
if should_break {
break 'route_loop;
}
}
// retry on loop around
retry_queue.append(&mut repeat_retries);
let should_break = handle_instruction(instruction, Some(&mut retry_queue))?;
if should_break {
break 'route_loop;
Expand Down

0 comments on commit a56dacb

Please sign in to comment.