ignore 400
This commit is contained in:
9
main.go
9
main.go
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user