Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions core/controller/channel-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,21 @@ func AutoTestBannedModels() {
continue
}

if channel.Status == model.ChannelStatusDisabled {
log.Infof("channel %s (type: %d, id: %d) is disabled, skip testing",
channel.Name,
channel.Type,
channel.ID,
)

err := monitor.ClearChannelModelErrors(context.Background(), modelName, channel.ID)
if err != nil {
log.Errorf("clear channel errors failed: %+v", err)
}

continue
}

result, err := testSingleModel(mc, channel, modelName, true)
if err != nil {
notify.Error(
Expand Down
44 changes: 22 additions & 22 deletions core/controller/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ import (
)

func parseCommonParams(c *gin.Context) (params struct {
group string
tokenName string
modelName string
channelID int
tokenID int
order string
requestID string
upstreamID string
codeType string
code int
withBody bool
ip string
user string
group string
tokenName string
modelName string
channelID int
tokenID int
order string
requestID string
upstreamID string
codeType string
code int
includeDetail bool
ip string
user string
},
) {
params.group = c.Query("group")
Expand All @@ -37,7 +37,7 @@ func parseCommonParams(c *gin.Context) (params struct {
params.upstreamID = c.Query("upstream_id")
params.codeType = c.Query("code_type")
params.code, _ = strconv.Atoi(c.Query("code"))
params.withBody, _ = strconv.ParseBool(c.Query("with_body"))
params.includeDetail, _ = strconv.ParseBool(c.Query("include_detail"))
params.ip = c.Query("ip")
params.user = c.Query("user")

Expand All @@ -62,7 +62,7 @@ func parseCommonParams(c *gin.Context) (params struct {
// @Param upstream_id query string false "Upstream ID"
// @Param code_type query string false "Status code type"
// @Param code query int false "Status code"
// @Param with_body query bool false "With body"
// @Param include_detail query bool false "Include request and response detail"
// @Param ip query string false "IP"
// @Param user query string false "User"
// @Success 200 {object} middleware.APIResponse{data=model.GetLogsResult}
Expand All @@ -82,7 +82,7 @@ func GetLogs(c *gin.Context) {
params.order,
model.CodeType(params.codeType),
params.code,
params.withBody,
params.includeDetail,
params.ip,
params.user,
page,
Expand Down Expand Up @@ -117,7 +117,7 @@ func GetLogs(c *gin.Context) {
// @Param upstream_id query string false "Upstream ID"
// @Param code_type query string false "Status code type"
// @Param code query int false "Status code"
// @Param with_body query bool false "With body"
// @Param include_detail query bool false "Include request and response detail"
// @Param ip query string false "IP"
// @Param user query string false "User"
// @Success 200 {object} middleware.APIResponse{data=model.GetGroupLogsResult}
Expand Down Expand Up @@ -145,7 +145,7 @@ func GetGroupLogs(c *gin.Context) {
params.order,
model.CodeType(params.codeType),
params.code,
params.withBody,
params.includeDetail,
params.ip,
params.user,
page,
Expand Down Expand Up @@ -181,7 +181,7 @@ func GetGroupLogs(c *gin.Context) {
// @Param upstream_id query string false "Upstream ID"
// @Param code_type query string false "Status code type"
// @Param code query int false "Status code"
// @Param with_body query bool false "With body"
// @Param include_detail query bool false "Include request and response detail"
// @Param ip query string false "IP"
// @Param user query string false "User"
// @Success 200 {object} middleware.APIResponse{data=model.GetLogsResult}
Expand All @@ -207,7 +207,7 @@ func SearchLogs(c *gin.Context) {
params.order,
model.CodeType(params.codeType),
params.code,
params.withBody,
params.includeDetail,
params.ip,
params.user,
page,
Expand Down Expand Up @@ -242,7 +242,7 @@ func SearchLogs(c *gin.Context) {
// @Param upstream_id query string false "Upstream ID"
// @Param code_type query string false "Status code type"
// @Param code query int false "Status code"
// @Param with_body query bool false "With body"
// @Param include_detail query bool false "Include request and response detail"
// @Param ip query string false "IP"
// @Param user query string false "User"
// @Success 200 {object} middleware.APIResponse{data=model.GetGroupLogsResult}
Expand Down Expand Up @@ -272,7 +272,7 @@ func SearchGroupLogs(c *gin.Context) {
params.order,
model.CodeType(params.codeType),
params.code,
params.withBody,
params.includeDetail,
params.ip,
params.user,
page,
Expand Down
Loading
Loading