implement move images command

- Also implement various importantr bugfixes for shutdown handling
This commit is contained in:
2024-04-30 19:45:00 +02:00
parent 36a42f95a5
commit ecea83fc4b
12 changed files with 226 additions and 127 deletions

View File

@ -27,6 +27,7 @@ impl PusStack {
.expect("time stamp generation error")
.to_vec()
.unwrap();
let mut loop_count = 0;
loop {
let mut nothing_to_do = true;
let mut is_srv_finished =
@ -69,6 +70,12 @@ impl PusStack {
self.mode_srv.poll_and_handle_next_tc(&time_stamp),
Some(self.mode_srv.poll_and_handle_next_reply(&time_stamp)),
);
// Safety mechanism to avoid infinite loops.
loop_count += 1;
if loop_count >= 500 {
log::warn!("reached PUS stack loop count 500, breaking");
break;
}
if nothing_to_do {
// Timeout checking is only done once.
self.action_srv_wrapper.check_for_request_timeouts();