fix(backend): cast cost calculation to numeric for postgresql round compatibility
This commit is contained in:
parent
b552a43a6a
commit
92d883ff90
|
|
@ -308,7 +308,7 @@ class PersistentUsageTracker:
|
||||||
stmt = text("""
|
stmt = text("""
|
||||||
UPDATE provider_monthly_usage
|
UPDATE provider_monthly_usage
|
||||||
SET requests_executed = requests_executed + 1,
|
SET requests_executed = requests_executed + 1,
|
||||||
estimated_cost_usd = round((requests_executed + 1) * :cost_per_req, 4),
|
estimated_cost_usd = round(CAST((requests_executed + 1) * :cost_per_req AS numeric), 4),
|
||||||
updated_at = :now
|
updated_at = :now
|
||||||
WHERE provider_id = :provider_id AND period_month = :period
|
WHERE provider_id = :provider_id AND period_month = :period
|
||||||
""")
|
""")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue