fix(client): repeat retry screen instruction (#3570)
This commit is contained in:
parent
b74f6c9861
commit
f968736a4e
1 changed files with 8 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue