mirror of
https://github.com/sogou/workflow.git
synced 2026-02-08 01:33:17 +08:00
Optimize timed thread/go task's state when timer failed.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -820,8 +820,17 @@ void __WFTimedThreadTask<INPUT, OUTPUT>::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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user