Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge "else" branches.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 5 Dec 2022 13:56:56 +0000 (14:56 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 5 Dec 2022 13:56:56 +0000 (14:56 +0100)
src/kernel/activity/ExecImpl.cpp
src/kernel/activity/IoImpl.cpp

index dc83190..61d194b 100644 (file)
@@ -153,13 +153,10 @@ void ExecImpl::post()
   } else if (surf_action_->get_state() == resource::Action::State::FAILED) {
     /* If all the hosts are running the synchro didn't fail, then the synchro was canceled */
     set_state(State::CANCELED);
-  } else if (timeout_detector_ && timeout_detector_->get_state() == resource::Action::State::FINISHED) {
-    if (surf_action_->get_remains() > 0.0) {
-      surf_action_->set_state(resource::Action::State::FAILED);
-      set_state(State::TIMEOUT);
-    } else {
-      set_state(State::DONE);
-    }
+  } else if (timeout_detector_ && timeout_detector_->get_state() == resource::Action::State::FINISHED &&
+             surf_action_->get_remains() > 0.0) {
+    surf_action_->set_state(resource::Action::State::FAILED);
+    set_state(State::TIMEOUT);
   } else {
     set_state(State::DONE);
   }
index 503f2e6..8bc0d40 100644 (file)
@@ -122,13 +122,10 @@ void IoImpl::post()
       set_state(State::FAILED);
     else
       set_state(State::CANCELED);
-  } else if (timeout_detector_ && timeout_detector_->get_state() == resource::Action::State::FINISHED) {
-    if (surf_action_->get_remains() > 0.0) {
-      surf_action_->set_state(resource::Action::State::FAILED);
-      set_state(State::TIMEOUT);
-    } else {
-      set_state(State::DONE);
-    }
+  } else if (timeout_detector_ && timeout_detector_->get_state() == resource::Action::State::FINISHED &&
+             surf_action_->get_remains() > 0.0) {
+    surf_action_->set_state(resource::Action::State::FAILED);
+    set_state(State::TIMEOUT);
   } else {
     set_state(State::DONE);
   }