Files
EdgeAPI/internal/db/models/node_dao_limit.go

20 lines
483 B
Go
Raw Normal View History

2022-09-18 12:39:17 +08:00
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
//go:build !plus
package models
import (
"github.com/iwind/TeaGo/dbs"
)
2023-03-05 16:48:49 +08:00
func (this *NodeDAO) CountAllAuthorityNodes(tx *dbs.Tx) (int64, error) {
return this.Query(tx).
State(NodeStateEnabled).
Where("clusterId IN (SELECT id FROM " + SharedNodeClusterDAO.Table + " WHERE state=1)").
Count()
}
2022-09-18 12:39:17 +08:00
func (this *NodeDAO) CheckNodesLimit(tx *dbs.Tx) error {
return nil
}