Skip to content

Commit

Permalink
change syncing query logic (#64)
Browse files Browse the repository at this point in the history
* change syncing query logic

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
sh-cha and coderabbitai[bot] authored Jan 22, 2025
1 parent 640649b commit 592baed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion challenger/challenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ func (c *Challenger) RegisterQuerier() {
if err != nil {
return err
}
return ctx.JSON(*status.Host.Node.Syncing && *status.Child.Node.Syncing)
hostSync := status.Host.Node.Syncing != nil && *status.Host.Node.Syncing
childSync := status.Child.Node.Syncing != nil && *status.Child.Node.Syncing
return ctx.JSON(hostSync || childSync)
})
}

Expand Down
2 changes: 1 addition & 1 deletion executor/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ func (ex *Executor) RegisterQuerier() {
hostSync := status.Host.Node.Syncing != nil && *status.Host.Node.Syncing
childSync := status.Child.Node.Syncing != nil && *status.Child.Node.Syncing
batchSync := status.BatchSubmitter.Node.Syncing != nil && *status.BatchSubmitter.Node.Syncing
return c.JSON(hostSync && childSync && batchSync)
return c.JSON(hostSync || childSync || batchSync)
})
}

0 comments on commit 592baed

Please sign in to comment.