Skip to content

Commit 592baed

Browse files
change syncing query logic (#64)
* 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>
1 parent 640649b commit 592baed

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

challenger/challenger.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ func (c *Challenger) RegisterQuerier() {
231231
if err != nil {
232232
return err
233233
}
234-
return ctx.JSON(*status.Host.Node.Syncing && *status.Child.Node.Syncing)
234+
hostSync := status.Host.Node.Syncing != nil && *status.Host.Node.Syncing
235+
childSync := status.Child.Node.Syncing != nil && *status.Child.Node.Syncing
236+
return ctx.JSON(hostSync || childSync)
235237
})
236238
}
237239

executor/querier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ func (ex *Executor) RegisterQuerier() {
7474
hostSync := status.Host.Node.Syncing != nil && *status.Host.Node.Syncing
7575
childSync := status.Child.Node.Syncing != nil && *status.Child.Node.Syncing
7676
batchSync := status.BatchSubmitter.Node.Syncing != nil && *status.BatchSubmitter.Node.Syncing
77-
return c.JSON(hostSync && childSync && batchSync)
77+
return c.JSON(hostSync || childSync || batchSync)
7878
})
7979
}

0 commit comments

Comments
 (0)