Skip to content

[Responsys] Setting timeout to 30 seconds #2693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DestinationDefinition, IntegrationError } from '@segment/actions-core'
import { DestinationDefinition, IntegrationError, DEFAULT_REQUEST_TIMEOUT } from '@segment/actions-core'

import type { Settings } from './generated-types'
import sendCustomTraits from './sendCustomTraits'
import sendAudience from './sendAudience'
Expand Down Expand Up @@ -222,7 +223,8 @@ const destination: DestinationDefinition<Settings> = {
headers: {
'Content-Type': 'application/json',
authorization: `${auth?.accessToken}`
}
},
timeout: Math.max(30_000, DEFAULT_REQUEST_TIMEOUT)
}
},
actions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const getAllPetsWaitInterval = 60

// createPet (`lists/${settings.profileListName}/listExtensions`, POST): 10 requests per minute.
// Around 1 request every 6000ms.
const createPetWaitInterval = 6000
// However, this wastes a lot of time (Centrifuge in general expects a response in 10 seconds, but this integration works with
// a 30 second timeout), so we are reducing this to 3 seconds.
const createPetWaitInterval = 3000

const action: ActionDefinition<Settings, Payload> = {
title: 'Send Audience as PET (Profile Extension Table)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export const sendToPet = async (

// createPet (`lists/${settings.profileListName}/listExtensions`, POST): 10 requests per minute.
// Around 1 request every 6000ms.
const createPetWaitInterval = 6000
// However, this wastes a lot of time (Centrifuge in general expects a response in 10 seconds, but this integration works with
// a 30 second timeout), so we are reducing this to 3 seconds.
const createPetWaitInterval = 3000

// sendToPet (`lists/${settings.profileListName}/listExtensions/${petName}/members`, POST): 500 requests per minute.
// Around 1 request every 120ms.
Expand Down
Loading