mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 04:30:05 +00:00
refactor: simplify server & service manipulation (#993)
* refactor: simplify server & service manipulation * update * fix * update for nat, ddns & notification * chore * update cron * update dependencies * use of function iterators * update default dns servers
This commit is contained in:
@@ -158,14 +158,11 @@ var requestGroup singleflight.Group
|
||||
|
||||
func getServerStat(withPublicNote, authorized bool) ([]byte, error) {
|
||||
v, err, _ := requestGroup.Do(fmt.Sprintf("serverStats::%t", authorized), func() (interface{}, error) {
|
||||
singleton.SortedServerLock.RLock()
|
||||
defer singleton.SortedServerLock.RUnlock()
|
||||
|
||||
var serverList []*model.Server
|
||||
if authorized {
|
||||
serverList = singleton.SortedServerList
|
||||
serverList = singleton.ServerShared.GetSortedList()
|
||||
} else {
|
||||
serverList = singleton.SortedServerListForGuest
|
||||
serverList = singleton.ServerShared.GetSortedListForGuest()
|
||||
}
|
||||
|
||||
servers := make([]model.StreamServer, 0, len(serverList))
|
||||
|
||||
Reference in New Issue
Block a user