mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2026-02-10 19:25:38 +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 {
|
if teaconst.MaxNodes > 0 {
|
||||||
count, err := this.Query(tx).
|
count, err := this.Query(tx).
|
||||||
State(NodeStateEnabled).
|
State(NodeStateEnabled).
|
||||||
|
Where("clusterId IN (SELECT id FROM " + SharedNodeClusterDAO.Table + " WHERE state=1)").
|
||||||
Count()
|
Count()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
|
|||||||
Reference in New Issue
Block a user