From 208127401938ad8bb862f4606a47de6c2b7407e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=95=E6=8C=AF=E6=9D=B0?= Date: Fri, 15 Aug 2025 16:20:22 +0800 Subject: [PATCH] close launch timer when connect callback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吕振杰 --- services/backup_sa/src/module_ipc/service.cpp | 1 + services/backup_sa/src/module_ipc/sub_service.cpp | 1 + .../backup_sa/src/module_sched/sched_scheduler.cpp | 12 ------------ 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/services/backup_sa/src/module_ipc/service.cpp b/services/backup_sa/src/module_ipc/service.cpp index f578df62f..638888773 100644 --- a/services/backup_sa/src/module_ipc/service.cpp +++ b/services/backup_sa/src/module_ipc/service.cpp @@ -1265,6 +1265,7 @@ void Service::ExtConnectDone(string bundleName) clearRecorder_->FindClearBundleRecord(bundleName)) { session_->SetServiceSchedAction(bundleName, BConstants::ServiceSchedAction::CLEAN); } else { + sched_->RemoveExtConn(bundleName); session_->SetServiceSchedAction(bundleName, BConstants::ServiceSchedAction::RUNNING); if (totalStatistic_ != nullptr) { session_->UpdateDfxInfo(bundleName, totalStatistic_->GetUniqId()); diff --git a/services/backup_sa/src/module_ipc/sub_service.cpp b/services/backup_sa/src/module_ipc/sub_service.cpp index d308767ee..37300712a 100644 --- a/services/backup_sa/src/module_ipc/sub_service.cpp +++ b/services/backup_sa/src/module_ipc/sub_service.cpp @@ -662,6 +662,7 @@ void Service::ExtConnectDied(const string &callName) } std::lock_guard lock(mutexPtr->callbackMutex); /* Clear Timer */ + sched_->RemoveExtConn(callName); session_->StopFwkTimer(callName); session_->StopExtTimer(callName); auto backUpConnection = session_->GetExtConnection(callName); diff --git a/services/backup_sa/src/module_sched/sched_scheduler.cpp b/services/backup_sa/src/module_sched/sched_scheduler.cpp index 70971f291..f9c9e2544 100644 --- a/services/backup_sa/src/module_sched/sched_scheduler.cpp +++ b/services/backup_sa/src/module_sched/sched_scheduler.cpp @@ -219,18 +219,6 @@ void SchedScheduler::StartExecuteBundleTask(const std::string &bundleName, BCons } } else if (action == BConstants::ServiceSchedAction::RUNNING) { HILOGI("Current bundle %{public}s process is running", bundleName.data()); - unique_lock lock(lock_); - auto iter = find_if(bundleTimeVec_.begin(), bundleTimeVec_.end(), [&bundleName](auto &obj) { - auto &[bName, iTime] = obj; - return bName == bundleName; - }); - if (iter == bundleTimeVec_.end()) { - throw BError(BError::Codes::SA_INVAL_ARG, "Failed to find timer"); - } - auto &[bName, iTime] = *iter; - // unregister timer - extTime_.Unregister(iTime); - lock.unlock(); //notify AppGallery to start restore if (reversePtr_ != nullptr) { reversePtr_->StartRunningTimer(bundleName); -- Gitee