Ver Fonte

feat: automatically ban channels that exceeded quota

CaIon há 2 anos atrás
pai
commit
a7cfce24d0
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      service/channel.go

+ 2 - 0
service/channel.go

@@ -57,6 +57,8 @@ func ShouldDisableChannel(err *relaymodel.OpenAIError, statusCode int) bool {
 		return true
 	} else if strings.HasPrefix(err.Message, "This organization has been disabled.") {
 		return true
+	} else if strings.HasPrefix(err.Message, "You exceeded your current quota") {
+		return true
 	}
 	return false
 }