diff --git a/frameworks/action_processer/include/action_processer.h b/frameworks/action_processer/include/action_processer.h index d97d4782db72860d05346c0adee81ee03d501971..9373f71a24084556a76ee78d8130d2ce4e63354b 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 e3b36889d120c050f6448b701f2f59e64be7ec73..c917b9418dde33fc9695e8e87ca03e55c2f8e6e0 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; }