mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-11-04 16:40:21 +00:00
chore: refactor
This commit is contained in:
1 parent
60de03142e
commit
c5cb385dc3
3 files changed
+12
-8
No files matched your search
@@ -160,15 +160,13 @@ func listServerWithServices(c *gin.Context) ([]uint64, error) {
|
||||
for _, id := range serverIdsWithService {
|
||||
singleton.ServerLock.RLock()
|
||||
server, ok := singleton.ServerList[id]
|
||||
if !ok {
|
||||
singleton.ServerLock.RUnlock()
|
||||
singleton.ServerLock.RUnlock()
|
||||
if !ok || server == nil {
|
||||
return nil, singleton.Localizer.ErrorT("server not found")
|
||||
}
|
||||
|
||||
if !server.HideForGuest || authorized {
|
||||
ret = append(ret, id)
|
||||
}
|
||||
singleton.ServerLock.RUnlock()
|
||||
}
|
||||
|
||||
return ret, nil
|
||||
|
||||
Reference in new issue
Block a user