mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-25 06:26:35 +08:00
判断节点数量时增加集群状态检查
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user