update: 线程安全

This commit is contained in:
Akkia
2022-05-18 10:28:24 +08:00
parent 990394bf46
commit 73df5fa0de
3 changed files with 13 additions and 0 deletions

View File

@@ -3,11 +3,13 @@ package singleton
import (
"github.com/naiba/nezha/model"
"github.com/naiba/nezha/pkg/utils"
"sync"
)
var (
ApiTokenList = make(map[string]*model.ApiToken)
UserIDToApiTokenList = make(map[uint64][]string)
ApiLock sync.RWMutex
)
type ServerAPI struct {