ignore 400

This commit is contained in:
2023-07-13 14:31:08 +08:00
parent 26520bc899
commit f0c7a95f77

View File

@@ -187,11 +187,6 @@ func main() {
// abort to error handle // abort to error handle
c.AbortWithError(502, err) c.AbortWithError(502, err)
// count failed
if err.Error() != "context canceled" {
go db.Model(&upstream).Update("failed_count", gorm.Expr("failed_count + ?", 1))
}
// send notification // send notification
upstreams := []OPENAI_UPSTREAM{} upstreams := []OPENAI_UPSTREAM{}
db.Find(&upstreams) db.Find(&upstreams)
@@ -207,7 +202,9 @@ func main() {
strings.Join(upstreamDescriptions, "\n"), strings.Join(upstreamDescriptions, "\n"),
) )
go sendMatrixMessage(content) go sendMatrixMessage(content)
if err.Error() != "context canceled" { if err.Error() != "context canceled" && r.Response.StatusCode != 400 {
// count failed
go db.Model(&upstream).Update("failed_count", gorm.Expr("failed_count + ?", 1))
go sendFeishuMessage(content) go sendFeishuMessage(content)
} }