mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-12 23:30:35 +00:00
fix(billing): improve quota handling and error reporting for pre-consume operations
This commit is contained in:
@@ -13,9 +13,7 @@ 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)
|
||||
// QuotaRoundStrict rejects an unrepresentable pre-consume estimate.
|
||||
func QuotaRoundStrict(f float64) (int, error) {
|
||||
return common.QuotaRoundStrict(f)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user