From 0ee0d3517a751f8f4bd50a0d825dfae0395ad7d8 Mon Sep 17 00:00:00 2001 From: oh_ci Date: Mon, 18 Aug 2025 06:37:05 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!314=20:?= =?UTF-8?q?=20=E3=80=90=E8=BD=BB=E9=87=8F=E7=BA=A7=20PR=E3=80=91=EF=BC=9A?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=93=8D=E4=BD=9C=E7=AD=89=E5=BE=85action?= =?UTF-8?q?=E5=AE=8C=E5=85=A8=E9=80=80=E5=87=BA=E6=89=8D=E8=83=BD=E6=B8=85?= =?UTF-8?q?=E7=90=86action'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../include/action_processer.h | 1 - .../action_processer/src/action_processer.cpp | 22 ++----------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/frameworks/action_processer/include/action_processer.h b/frameworks/action_processer/include/action_processer.h index d97d478..9373f71 100644 --- a/frameworks/action_processer/include/action_processer.h +++ b/frameworks/action_processer/include/action_processer.h @@ -39,7 +39,6 @@ public: bool SetCpuAffinity(unsigned int reservedCores); private: - bool WaitActionExit(); void StartNextAction(); std::shared_ptr statusManager_ {}; diff --git a/frameworks/action_processer/src/action_processer.cpp b/frameworks/action_processer/src/action_processer.cpp index e3b3688..c917b94 100644 --- a/frameworks/action_processer/src/action_processer.cpp +++ b/frameworks/action_processer/src/action_processer.cpp @@ -14,8 +14,7 @@ */ #include "action_processer.h" -#include -#include + #include "sys_installer_manager.h" #include "log/log.h" @@ -27,23 +26,6 @@ bool ActionProcesser::IsRunning() return isRunning_ || isSuspend_; } -bool ActionProcesser::WaitActionExit() -{ - using namespace std::chrono_literals; - const unsigned int WAIT_MAX_SECOND = 4; - unsigned int count = 0; - while (IsRunning() && (count < WAIT_MAX_SECOND)) { - std::this_thread::sleep_for(1s); - count++; - } - if (count == WAIT_MAX_SECOND) { - LOG(ERROR) << "wait action exit failed for " << WAIT_MAX_SECOND << "s"; - return false; - } - LOG(INFO) << "action exit after " << count << "s"; - return true; -} - void ActionProcesser::AddAction(std::unique_ptr action) { if (isRunning_ || action == nullptr) { @@ -90,7 +72,7 @@ bool ActionProcesser::Stop() LOG(INFO) << "Stop " << curAction_->GetActionName(); ret = curAction_->TerminateAction(); } - if (!ret || !WaitActionExit()) { + if (!ret) { LOG(INFO) << "Stop action failed, directly returned"; return false; } -- Gitee