Skip to content

Commit

Permalink
#1942: check if we have TS keys before running its refresh logic
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Dec 20, 2024
1 parent 9f5bb89 commit e468346
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/metadataTypes/Journey.js
Original file line number Diff line number Diff line change
Expand Up @@ -2793,12 +2793,16 @@ class Journey extends MetadataType {
)
);

// refresh TriggeredSends
TriggeredSend.buObject = this.buObject;
TriggeredSend.client = this.client;
TriggeredSend.properties = this.properties;
// hard-refresh all triggeredSends even if the TS was paused (inactive) before
await TriggeredSend.refresh(tsKeys, false);
if (tsKeys.length) {
// refresh TriggeredSends
TriggeredSend.buObject = this.buObject;
TriggeredSend.client = this.client;
TriggeredSend.properties = this.properties;
// hard-refresh all triggeredSends even if the TS was paused (inactive) before
await TriggeredSend.refresh(tsKeys, false);
} else {
Util.logger.info(Util.getGrayMsg('No triggeredSends found to refresh'));
}

Util.logger.info(
`Refreshed ${refreshedKeyArr.length} of ${keyArr.length} ${this.definition.type}`
Expand Down

0 comments on commit e468346

Please sign in to comment.