fix service api (#556)

* fix service api

* update ServiceResponseItem

* fix: ddns lock
This commit is contained in:
UUBulb
2024-12-05 21:00:02 +08:00
committed by GitHub
parent 2234cff5eb
commit 040c8df02e
10 changed files with 124 additions and 53 deletions

View File

@@ -14,6 +14,7 @@ var (
NATIDToDomain = make(map[uint64]string)
NATList []*model.NAT
NATListLock sync.RWMutex
)
func initNAT() {
@@ -55,6 +56,9 @@ func UpdateNATList() {
NATCacheRwLock.RLock()
defer NATCacheRwLock.RUnlock()
NATListLock.Lock()
defer NATListLock.Unlock()
NATList = make([]*model.NAT, 0, len(NATCache))
for _, n := range NATCache {
NATList = append(NATList, n)