Skip to content

Commit 34cd63a

Browse files
committed
Adding max initial events to "New Deal in Stage"
1 parent bbe6b5b commit 34cd63a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

components/hubspot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/hubspot",
3-
"version": "1.7.10",
3+
"version": "1.7.11",
44
"description": "Pipedream Hubspot Components",
55
"main": "hubspot.app.mjs",
66
"keywords": [

components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default {
1111
key: "hubspot-new-deal-in-stage",
1212
name: "New Deal In Stage",
1313
description: "Emit new event for each new deal in a stage.",
14-
version: "0.0.41",
14+
version: "0.0.42",
1515
dedupe: "unique",
1616
type: "source",
1717
props: {
@@ -89,6 +89,8 @@ export default {
8989
},
9090
async processDeals(params, after) {
9191
let maxTs = after || 0;
92+
let initialEventsEmitted = 0;
93+
const maxInitialEvents = 25;
9294

9395
do {
9496
const results = await this.hubspot.searchCRM(params);
@@ -111,6 +113,9 @@ export default {
111113
maxTs = ts;
112114
this._setAfter(ts);
113115
}
116+
if (!after && ++initialEventsEmitted >= maxInitialEvents) {
117+
return;
118+
}
114119
}
115120
}
116121

0 commit comments

Comments
 (0)