fix(billing): reject saturated pre-consume quota
This commit is contained in:
@@ -12,3 +12,10 @@ import "github.com/QuantumNous/new-api/common"
|
||||
func QuotaRound(f float64) int {
|
||||
return common.QuotaRound(f)
|
||||
}
|
||||
|
||||
// QuotaRoundChecked is QuotaRound but also reports whether the result had to
|
||||
// be saturated. Pre-consume callers use this to reject an unrepresentable
|
||||
// estimate before any quota is deducted.
|
||||
func QuotaRoundChecked(f float64) (int, *common.QuotaClamp) {
|
||||
return common.QuotaRoundChecked(f)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user