Skip to content

Commit

Permalink
🧑‍💻 (webhook) Disable webhook timeout if CHAT_API_TIM…
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Jan 2, 2024
1 parent c211f21 commit e8b9ef4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/bot-engine/executeIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { ExecuteIntegrationResponse } from './types'
import { IntegrationBlockType } from '@typebot.io/schemas/features/blocks/integrations/constants'
import { executeOpenAIBlock } from './blocks/integrations/legacy/openai/executeOpenAIBlock'
import { executeForgedBlock } from './forge/executeForgedBlock'
import { isNotDefined } from '@typebot.io/lib'
import { env } from '@typebot.io/env'

export const executeIntegration =
(state: SessionState) =>
Expand All @@ -33,7 +35,11 @@ export const executeIntegration =
startTimeShouldBeUpdated: true,
}
case IntegrationBlockType.WEBHOOK:
return executeWebhookBlock(state, block)
return {
...(await executeWebhookBlock(state, block, {
disableRequestTimeout: isNotDefined(env.CHAT_API_TIMEOUT),
})),
}
case IntegrationBlockType.OPEN_AI:
return {
...(await executeOpenAIBlock(state, block)),
Expand Down

0 comments on commit e8b9ef4

Please sign in to comment.