From 32ffebb01dbd360e8968181bbfcad1dd4f29aee0 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 12 Jun 2023 14:10:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E5=81=9C=E7=94=A8=E7=9A=84=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E4=B8=8D=E8=AE=A1=E7=AE=97=E5=9C=A8=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E9=87=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/db/models/node_dao.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/db/models/node_dao.go b/internal/db/models/node_dao.go index 7a2dc776..e8a1009c 100644 --- a/internal/db/models/node_dao.go +++ b/internal/db/models/node_dao.go @@ -295,6 +295,7 @@ func (this *NodeDAO) CountAllEnabledNodes(tx *dbs.Tx) (int64, error) { func (this *NodeDAO) CountAllEnabledOfflineNodes(tx *dbs.Tx) (int64, error) { return this.Query(tx). State(NodeStateEnabled). + Attr("isOn", true). Where("clusterId IN (SELECT id FROM "+SharedNodeClusterDAO.Table+" WHERE state=:clusterState)"). Param("clusterState", NodeClusterStateEnabled). Where("(status IS NULL OR NOT JSON_EXTRACT(status, '$.isActive') OR UNIX_TIMESTAMP()-JSON_EXTRACT(status, '$.updatedAt')>60)").