Skip to content

Commit

Permalink
[feat] change timeout strategy. node in groups will not run if its fo…
Browse files Browse the repository at this point in the history
…rmer timeout.
  • Loading branch information
ChunelFeng committed Dec 31, 2023
1 parent 3e19417 commit 09652e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/GraphCtrl/GraphElement/GElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ CStatus GElement::addDependGElements(const GElementPtrSet& elements) {
CGRAPH_FUNCTION_BEGIN
if (!isMutable()) {
// 如果是 mutable的逻辑,则可以在 init之后,修改依赖关系
CGRAPH_ASSERT_INIT(false);
CGRAPH_ASSERT_INIT(false)
}

for (GElementPtr cur: elements) {
Expand Down Expand Up @@ -247,7 +247,7 @@ CStatus GElement::fatProcessor(const CFunctionType& type) {
}

trigger_times_++; // 记录实际上触发了多少次,而不是正式执行了多少次
for (CSize i = 0; i < this->loop_ && GElementState::NORMAL == cur_state_.load(std::memory_order_acquire); i++) {
for (CSize i = 0; i < this->loop_ && GElementState::NORMAL == this->getCurState(); i++) {
/** 执行带切面的run方法 */
status = doAspect(GAspectType::BEGIN_RUN);
CGRAPH_FUNCTION_CHECK_STATUS
Expand Down Expand Up @@ -438,7 +438,7 @@ GElementState GElement::getCurState() const {
* 如果有超时逻辑的话,优先判断
* 否则就是当前的状态
*/
GElementState state = this->isTimeout() ? GElementState::TIMEOUT : cur_state_.load(std::memory_order_acquire);
auto state = this->isTimeout() ? GElementState::TIMEOUT : cur_state_.load(std::memory_order_acquire);
return state;
}

Expand Down

0 comments on commit 09652e8

Please sign in to comment.