mirror of
https://gitee.com/openharmony/commonlibrary_ets_utils
synced 2024-11-23 07:20:14 +00:00
!1636 fix onExecutionFailedCallBackInfo bug in taskgroup
Merge pull request !1636 from huangfeijie/fix_group_cancel
This commit is contained in:
commit
27ecf90cec
@ -559,7 +559,10 @@ void TaskPool::UpdateGroupInfoByResult(napi_env env, Task* task, napi_value res,
|
||||
napi_value res = nullptr;
|
||||
napi_get_element(env, resArr, groupInfo->GetFailedIndex(), &res);
|
||||
napi_reject_deferred(env, groupInfo->deferred, res);
|
||||
if (task->onExecutionFailedCallBackInfo_ != nullptr) {
|
||||
auto iter = taskGroup->taskIds_.begin();
|
||||
std::advance(iter, groupInfo->GetFailedIndex());
|
||||
auto task = iter != taskGroup->taskIds_.end() ? TaskManager::GetInstance().GetTask(*iter) : nullptr;
|
||||
if (task != nullptr && task->onExecutionFailedCallBackInfo_ != nullptr) {
|
||||
task->onExecutionFailedCallBackInfo_->taskError_ = res;
|
||||
task->ExecuteListenerCallback(task->onExecutionFailedCallBackInfo_);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user