fix: 修复前一个任务刚完成就停止,UI卡住的问题

This commit is contained in:
MistEO
2022-11-22 22:50:57 +08:00
parent 63c5d9945f
commit 9f20fe8dca

View File

@@ -300,6 +300,10 @@ void Assistant::working_proc()
const int delay = Configer.get_options().task_delay;
lock.lock();
m_condvar.wait_for(lock, std::chrono::milliseconds(delay), [&]() -> bool { return m_thread_idle; });
if (m_thread_idle) {
task_callback(AsstMsg::TaskChainStopped, callback_json, this);
}
}
else {
m_thread_idle = true;