mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-06 13:40:06 +00:00
fix service api (#556)
* fix service api * update ServiceResponseItem * fix: ddns lock
This commit is contained in:
@@ -19,6 +19,7 @@ var (
|
||||
DDNSCache map[uint64]*model.DDNSProfile
|
||||
DDNSCacheLock sync.RWMutex
|
||||
DDNSList []*model.DDNSProfile
|
||||
DDNSListLock sync.RWMutex
|
||||
)
|
||||
|
||||
func initDDNS() {
|
||||
@@ -52,6 +53,9 @@ func UpdateDDNSList() {
|
||||
DDNSCacheLock.RLock()
|
||||
defer DDNSCacheLock.RUnlock()
|
||||
|
||||
DDNSListLock.Lock()
|
||||
defer DDNSListLock.Unlock()
|
||||
|
||||
DDNSList = make([]*model.DDNSProfile, 0, len(DDNSCache))
|
||||
for _, p := range DDNSCache {
|
||||
DDNSList = append(DDNSList, p)
|
||||
|
||||
Reference in New Issue
Block a user