Skip to content

Commit

Permalink
chore: handle too many soql queries in salesforce
Browse files Browse the repository at this point in the history
  • Loading branch information
Sai Sankeerth committed Jun 24, 2024
1 parent a0f5c2f commit fc153d1
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'))

Check warning on line 62 in src/v0/destinations/salesforce/utils.js

View check run for this annotation

Codecov / codecov/patch

src/v0/destinations/salesforce/utils.js#L61-L62

Added lines #L61 - L62 were not covered by tests
) {
// 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 fc153d1

Please sign in to comment.