fix.修复信用商店没有要买的东西的时候会卡住的问题

This commit is contained in:
MistEO
2021-11-23 23:14:59 +08:00
parent 3eaaf2ff99
commit 5c0b2e41ee
2 changed files with 3 additions and 2 deletions

View File

@@ -163,6 +163,7 @@ bool asst::Assistance::append_visit(bool with_shopping, bool only_append)
if (with_shopping) {
auto shopping_task_ptr = std::make_shared<CreditShoppingTask>(task_callback, (void*)this);
shopping_task_ptr->set_retry_times(5);
shopping_task_ptr->set_task_chain("CreditShopping");
m_tasks_deque.emplace_back(shopping_task_ptr);
}
@@ -391,7 +392,7 @@ void Assistance::working_proc()
bool ret = task_ptr->run();
if (ret) {
retry_times = 0;
if (m_tasks_deque.empty()
if (m_tasks_deque.empty()
|| task_ptr->get_task_chain() != m_tasks_deque.front()->get_task_chain()) {
json::value task_all_completed_json;
task_all_completed_json["task_chain"] = task_ptr->get_task_chain();

View File

@@ -23,7 +23,7 @@ bool asst::CreditShoppingTask::run()
CreditShopImageAnalyzer shop_analyzer(image);
if (!shop_analyzer.analyze()) {
return false;
return true;
}
const auto& shopping_list = shop_analyzer.get_result();