- /* Add the process to the list of process to restart, only if the host is down */
- if (self->auto_restart_ && self->host_->is_off()) {
- SIMIX_host_add_auto_restart_process(self->host_, self->get_cname(), self->code, self->get_user_data(),
- SIMIX_timer_get_date(self->kill_timer), self->get_properties(),
- self->auto_restart_);
+
+ if (self->auto_restart_ && self->host_->is_off() &&
+ watched_hosts.find(self->host_->get_cname()) == watched_hosts.end()) {
+ XBT_DEBUG("Push host %s to watched_hosts because it's off and %s needs to restart", self->host_->get_cname(),
+ self->get_cname());
+ watched_hosts.insert(self->host_->get_cname());