diff options
Diffstat (limited to 'src/components/policy/policy_regular/src/update_status_manager.cc')
-rw-r--r-- | src/components/policy/policy_regular/src/update_status_manager.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/policy/policy_regular/src/update_status_manager.cc b/src/components/policy/policy_regular/src/update_status_manager.cc index c37f8bbadc..aa8d8cb3a2 100644 --- a/src/components/policy/policy_regular/src/update_status_manager.cc +++ b/src/components/policy/policy_regular/src/update_status_manager.cc @@ -54,6 +54,11 @@ void UpdateStatusManager::ProcessEvent(UpdateEvent event) { DoTransition(); } +void UpdateStatusManager::PendingUpdate() { + LOG4CXX_AUTO_TRACE(logger_); + ProcessEvent(kPendingUpdate); +} + void UpdateStatusManager::SetNextStatus(std::shared_ptr<Status> status) { next_status_ = status; } @@ -173,7 +178,10 @@ void UpdateStatusManager::DoTransition() { current_status_ = next_status_; next_status_.reset(); LOG4CXX_DEBUG(logger_, "last_processed_event_ = " << last_processed_event_); - if (last_processed_event_ != kScheduleManualUpdate) { + const bool is_update_pending = + policy::StatusProcessingSnapshot == current_status_->get_status(); + + if (last_processed_event_ != kScheduleManualUpdate && !is_update_pending) { listener_->OnUpdateStatusChanged(current_status_->get_status_string()); } if (!postponed_status_) { |