mirror of
https://gitee.com/openharmony/commonlibrary_ets_utils
synced 2024-11-23 07:20:14 +00:00
fix onExecutionFailedCallBackInfo bug in taskgroup fix onExecutionFailedCallBackInfo bug in taskgroup Signed-off-by: huangfeijie <huangfeijie@huawei.com>
This commit is contained in:
parent
c7218eb8d9
commit
3d7203c95c
@ -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