Skip to content

Commit 2a4ed49

Browse files
committed
wip: zen
1 parent 7528419 commit 2a4ed49

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • packages/console/app/src/routes/zen/util

packages/console/app/src/routes/zen/util/handler.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,15 @@ export async function handler(
245245
dataDumper?.flush()
246246
await rateLimiter?.track()
247247
const usage = usageParser.retrieve()
248-
let cost = "0"
249248
if (usage) {
250249
const usageInfo = providerInfo.normalizeUsage(usage)
251250
const costInfo = calculateCost(modelInfo, usageInfo)
252251
await trialLimiter?.track(usageInfo)
253252
await trackUsage(sessionId, billingSource, authInfo, modelInfo, providerInfo, usageInfo, costInfo)
254253
await reload(billingSource, authInfo, costInfo)
255-
cost = calculateOccuredCost(billingSource, costInfo)
254+
const cost = calculateOccuredCost(billingSource, costInfo)
255+
c.enqueue(encoder.encode(usageParser.buidlCostChunk(cost)))
256256
}
257-
c.enqueue(encoder.encode(usageParser.buidlCostChunk(cost)))
258257
c.close()
259258
return
260259
}

0 commit comments

Comments
 (0)