️ refactor: 将排序的服务器列表的锁拆分出来

This commit is contained in:
naiba
2021-01-17 22:18:36 +08:00
parent d059835877
commit bf71aeaaf9
5 changed files with 24 additions and 17 deletions

View File

@@ -29,8 +29,8 @@ func (mp *memberPage) serve() {
}
func (mp *memberPage) server(c *gin.Context) {
dao.ServerLock.RLock()
defer dao.ServerLock.RUnlock()
dao.SortedServerLock.RLock()
defer dao.SortedServerLock.RUnlock()
c.HTML(http.StatusOK, "dashboard/server", mygin.CommonEnvironment(c, gin.H{
"Title": "服务器管理",
"Servers": dao.SortedServerList,