fix: 流量统计异常

This commit is contained in:
naiba
2024-08-12 10:06:55 +08:00
parent b1d77a1d27
commit 6abc0fce51
5 changed files with 13 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ import (
"net/http"
"strconv"
"strings"
"sync"
"time"
"github.com/gin-gonic/gin"
@@ -384,6 +385,7 @@ func (ma *memberAPI) addOrEditServer(c *gin.Context) {
} else {
s.Host = &model.Host{}
s.State = &model.HostState{}
s.TaskCloseLock = new(sync.Mutex)
singleton.ServerLock.Lock()
singleton.SecretToID[s.Secret] = s.ID
singleton.ServerList[s.ID] = &s