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

This commit is contained in:
刘祥超
2022-04-14 22:00:47 +08:00
parent 8177f3d7e4
commit 08b5dd7531

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