Skip to content

Commit

Permalink
Increase LiveRamp batch size to 1M (#1392)
Browse files Browse the repository at this point in the history
* increase batch size for LiveRamp to 10M

* lower batch size for LiveRamp to 1M

* use a less expensive way to test authentication for LiveRamp SFTP
  • Loading branch information
rhall-twilio authored Jul 13, 2023
1 parent 6c19a3f commit 8ff8174
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const action: ActionDefinition<Settings, Payload> = {
description: 'Maximum number of events to include in each batch. Actual batch sizes may be lower.',
type: 'number',
required: false,
default: 100000
default: 1000000
}
},
perform: async (request, { settings, payload }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ async function doSFTP(sftp: Client, settings: Settings, action: { (sftp: Client)
password: settings.sftp_password
})

await action(sftp)
const retVal = await action(sftp)
await sftp.end()
return retVal
}

async function testAuthenticationSFTP(sftp: Client, settings: Settings) {
return doSFTP(sftp, settings, async (sftp) => {
return sftp.list(settings.sftp_folder_path as string)
return sftp.exists(settings.sftp_folder_path as string).then((fileType) => {
if (!fileType) throw new Error(`Could not find path: ${settings.sftp_folder_path}`)
})
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const destination: DestinationDefinition<Settings> = {
// S3 authentication is skipped to avoid requiring a GetObject permission on the IAM role.
if (settings.upload_mode == 'SFTP') {
const sftpClient = new ClientSFTP()
await testAuthenticationSFTP(sftpClient, settings)
return await testAuthenticationSFTP(sftpClient, settings)
}
}
},
Expand Down

0 comments on commit 8ff8174

Please sign in to comment.