mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-06 05:30:05 +00:00
fix service api (#556)
* fix service api * update ServiceResponseItem * fix: ddns lock
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user