diff --git a/src/factory/WFTaskFactory.cc b/src/factory/WFTaskFactory.cc index 0ab289b8..35557c38 100644 --- a/src/factory/WFTaskFactory.cc +++ b/src/factory/WFTaskFactory.cc @@ -847,8 +847,17 @@ void __WFTimedGoTask::timer_callback(WFTimerTask *timer) if (--task->ref == 3) { - task->state = WFT_STATE_SYS_ERROR; - task->error = ETIMEDOUT; + if (timer->get_state() == WFT_STATE_SUCCESS) + { + task->state = WFT_STATE_SYS_ERROR; + task->error = ETIMEDOUT; + } + else + { + task->state = timer->get_state(); + task->error = timer->get_error(); + } + task->subtask_done(); } diff --git a/src/factory/WFTaskFactory.inl b/src/factory/WFTaskFactory.inl index 04e13afc..cf737744 100644 --- a/src/factory/WFTaskFactory.inl +++ b/src/factory/WFTaskFactory.inl @@ -820,8 +820,17 @@ void __WFTimedThreadTask::timer_callback(WFTimerTask *timer) if (--task->ref == 3) { - task->state = WFT_STATE_SYS_ERROR; - task->error = ETIMEDOUT; + if (timer->get_state() == WFT_STATE_SUCCESS) + { + task->state = WFT_STATE_SYS_ERROR; + task->error = ETIMEDOUT; + } + else + { + task->state = timer->get_state(); + task->error = timer->get_error(); + } + task->subtask_done(); }