Skip to content

Commit

Permalink
chore: handle too many soql queries in salesforce (#3498)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpj2292 authored Jul 2, 2024
1 parent aa0ea60 commit f71c105
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/v0/destinations/salesforce/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ const salesforceResponseHandler = (destResponse, sourceMessage, authKey, authori
} else if (
status === 400 &&
matchErrorCode('CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY') &&
response?.message?.includes('UNABLE_TO_LOCK_ROW')
(response?.message?.includes('UNABLE_TO_LOCK_ROW') ||
response?.message?.includes('Too many SOQL queries'))
) {
// handling the error case where the record is locked by another background job
// this is a retryable error
throw new RetryableError(
`${DESTINATION} Request Failed - "Row locked due to another background running on the same object", (Retryable) ${sourceMessage}`,
`${DESTINATION} Request Failed - "${response.message}", (Retryable) ${sourceMessage}`,
500,
destResponse,
);
Expand Down

0 comments on commit f71c105

Please sign in to comment.