判断节点数量时增加集群状态检查

This commit is contained in:
GoEdgeLab
2022-04-14 22:00:47 +08:00
parent 2197070ddd
commit 4cdf4d9dba

View File

@@ -139,6 +139,7 @@ func (this *NodeDAO) CreateNode(tx *dbs.Tx, adminId int64, name string, clusterI
if teaconst.MaxNodes > 0 {
count, err := this.Query(tx).
State(NodeStateEnabled).
Where("clusterId IN (SELECT id FROM " + SharedNodeClusterDAO.Table + " WHERE state=1)").
Count()
if err != nil {
return 0, err