aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel de Prada Corral <6536835+manueldeprada@users.noreply.github.com>2024-10-16 09:00:41 +0200
committerGitHub <noreply@github.com>2024-10-16 09:00:41 +0200
commitf968736a4eb953a2e086c867a0524e185ae50dba (patch)
treefe4cd3013e759c5ccae712f5a3a55eea92b6df80
parentdocs(changelog): rebind keys plugin api (diff)
downloadsl0ppij-f968736a4eb953a2e086c867a0524e185ae50dba.tar.gz
sl0ppij-f968736a4eb953a2e086c867a0524e185ae50dba.tar.xz
sl0ppij-f968736a4eb953a2e086c867a0524e185ae50dba.zip
fix(client): repeat retry screen instruction (#3570)
-rw-r--r--zellij-server/src/route.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/zellij-server/src/route.rs b/zellij-server/src/route.rs
index 2580a12d..b0f5cce6 100644
--- a/zellij-server/src/route.rs
+++ b/zellij-server/src/route.rs
@@ -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;