refactor: improve performance

This commit is contained in:
naiba
2024-12-22 17:23:55 +08:00
parent a550709c95
commit 7c8ac7ae5a
4 changed files with 62 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import (
"golang.org/x/crypto/bcrypt"
"github.com/nezhahq/nezha/model"
"github.com/nezhahq/nezha/pkg/utils"
"github.com/nezhahq/nezha/service/singleton"
)
@@ -208,7 +209,7 @@ func batchBlockOnlineUser(c *gin.Context) (any, error) {
return nil, err
}
if err := singleton.BlockByIPs(list); err != nil {
if err := singleton.BlockByIPs(utils.Unique(list)); err != nil {
return nil, newGormError("%v", err)
}