feat: gemini postpaid billing (skip credit_balance deduction)
This commit is contained in:
@@ -100,8 +100,8 @@ impl RequestLogger {
|
|||||||
.execute(&mut *tx)
|
.execute(&mut *tx)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
// Deduct from provider balance if successful
|
// Deduct from provider balance if successful (skip postpaid like Gemini)
|
||||||
if log.cost > 0.0 {
|
if log.cost > 0.0 && log.provider != "gemini" {
|
||||||
sqlx::query("UPDATE provider_configs SET credit_balance = credit_balance - ? WHERE id = ?")
|
sqlx::query("UPDATE provider_configs SET credit_balance = credit_balance - ? WHERE id = ?")
|
||||||
.bind(log.cost)
|
.bind(log.cost)
|
||||||
.bind(&log.provider)
|
.bind(&log.provider)
|
||||||
|
|||||||
Reference in New Issue
Block a user