fix(client): repeat retry screen instruction (#3570)

This commit is contained in:
Manuel de Prada Corral 2024-10-16 09:00:41 +02:00 committed by GitHub
parent b74f6c9861
commit f968736a4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,
@ -1220,13 +1222,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;