File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
apps/sim/lib/knowledge/documents Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import {
2626 sql ,
2727} from 'drizzle-orm'
2828import { recordUsage } from '@/lib/billing/core/usage-log'
29+ import { checkAndBillOverageThreshold } from '@/lib/billing/threshold-billing'
2930import { createBullMQJobData , isBullMQEnabled } from '@/lib/core/bullmq'
3031import { env } from '@/lib/core/config/env'
3132import { getCostMultiplier , isTriggerDevEnabled } from '@/lib/core/config/feature-flags'
@@ -682,6 +683,7 @@ export async function processDocumentAsync(
682683 totalTokensUsed : sql `total_tokens_used + ${ totalEmbeddingTokens } ` ,
683684 } ,
684685 } )
686+ await checkAndBillOverageThreshold ( kb [ 0 ] . userId )
685687 } else {
686688 logger . warn (
687689 `[${ documentId } ] Embedding model "${ embeddingModelName } " has no pricing entry — billing skipped` ,
You can’t perform that action at this time.
0 commit comments