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

Function configurePollingIfNeeded

apps/sim/lib/webhooks/deploy.ts:376–396  ·  view source on GitHub ↗
(
  provider: string,
  savedWebhook: Record<string, unknown>,
  requestId: string
)

Source from the content-addressed store, hash-verified

374}
375
376async function configurePollingIfNeeded(
377 provider: string,
378 savedWebhook: Record<string, unknown>,
379 requestId: string
380): Promise<TriggerSaveError | null> {
381 const handler = getProviderHandler(provider)
382 if (!handler.configurePolling) {
383 return null
384 }
385
386 const success = await handler.configurePolling({ webhook: savedWebhook, requestId })
387 if (!success) {
388 await db.delete(webhook).where(eq(webhook.id, savedWebhook.id as string))
389 return {
390 message: `Failed to configure ${provider} polling. Please check your account permissions.`,
391 status: 500,
392 }
393 }
394
395 return null
396}
397
398async function syncCredentialSetWebhooks(params: {
399 workflowId: string

Callers 1

Calls 4

getProviderHandlerFunction · 0.90
configurePollingMethod · 0.80
deleteMethod · 0.65
eqFunction · 0.50

Tested by

no test coverage detected