MCPcopy Index your code
hub / github.com/simstudioai/sim / markWebhookSuccess

Function markWebhookSuccess

apps/sim/lib/webhooks/polling/utils.ts:56–70  ·  view source on GitHub ↗
(webhookId: string, logger: Logger)

Source from the content-addressed store, hash-verified

54
55/** Reset the webhook's failure count on successful poll. */
56export async function markWebhookSuccess(webhookId: string, logger: Logger): Promise<void> {
57 try {
58 await db
59 .update(webhook)
60 .set({
61 failedCount: 0,
62 updatedAt: new Date(),
63 })
64 .where(
65 and(eq(webhook.id, webhookId), or(isNull(webhook.failedCount), ne(webhook.failedCount, 0)))
66 )
67 } catch (err) {
68 logger.error(`Failed to mark webhook ${webhookId} as successful:`, err)
69 }
70}
71
72/** Fetch all active webhooks for a provider, joined with their workflow. */
73export async function fetchActiveWebhooks(

Callers 9

pollWebhookFunction · 0.90
pollWebhookFunction · 0.90
pollWebhookFunction · 0.90
pollSearchBasedFunction · 0.90
pollListMembershipFunction · 0.90
pollWebhookFunction · 0.90
pollWebhookFunction · 0.90
pollWebhookFunction · 0.90
pollWebhookFunction · 0.90

Calls 3

errorMethod · 0.80
setMethod · 0.65
eqFunction · 0.50

Tested by

no test coverage detected