|
1 | 1 | import { db } from '@sim/db' |
2 | | -import { userStats, webhook, workflow as workflowTable } from '@sim/db/schema' |
| 2 | +import { webhook, workflow as workflowTable } from '@sim/db/schema' |
3 | 3 | import { task } from '@trigger.dev/sdk' |
4 | | -import { eq, sql } from 'drizzle-orm' |
| 4 | +import { eq } from 'drizzle-orm' |
5 | 5 | import { v4 as uuidv4 } from 'uuid' |
6 | 6 | import { checkServerSideUsageLimits } from '@/lib/billing' |
7 | 7 | import { getPersonalAndWorkspaceEnv } from '@/lib/environment/utils' |
@@ -291,15 +291,6 @@ async function executeWebhookJobInternal( |
291 | 291 | // Update workflow run counts on success |
292 | 292 | if (executionResult.success) { |
293 | 293 | await updateWorkflowRunCounts(payload.workflowId) |
294 | | - |
295 | | - // Track execution in user stats |
296 | | - await db |
297 | | - .update(userStats) |
298 | | - .set({ |
299 | | - totalWebhookTriggers: sql`total_webhook_triggers + 1`, |
300 | | - lastActive: sql`now()`, |
301 | | - }) |
302 | | - .where(eq(userStats.userId, payload.userId)) |
303 | 294 | } |
304 | 295 |
|
305 | 296 | // Build trace spans and complete logging session |
@@ -492,17 +483,6 @@ async function executeWebhookJobInternal( |
492 | 483 | // Update workflow run counts on success |
493 | 484 | if (executionResult.success) { |
494 | 485 | await updateWorkflowRunCounts(payload.workflowId) |
495 | | - |
496 | | - // Track execution in user stats (skip in test mode) |
497 | | - if (!payload.testMode) { |
498 | | - await db |
499 | | - .update(userStats) |
500 | | - .set({ |
501 | | - totalWebhookTriggers: sql`total_webhook_triggers + 1`, |
502 | | - lastActive: sql`now()`, |
503 | | - }) |
504 | | - .where(eq(userStats.userId, payload.userId)) |
505 | | - } |
506 | 486 | } |
507 | 487 |
|
508 | 488 | // Build trace spans and complete logging session |
|
0 commit comments