Skip to content

Commit

Permalink
handle condition if customer pass empty stream do not create sqs mess…
Browse files Browse the repository at this point in the history
…age for that
  • Loading branch information
Rakhi Mundhada authored and Rakhi Mundhada committed Oct 8, 2024
1 parent edca08b commit 8448ab8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions collectors/googlestackdriver/collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ class GooglestackdriverCollector extends PawsCollector {
endTs = moment(startTs).add(this.pollInterval, 'seconds').toISOString();
}
const resourceNames = JSON.parse(process.env.collector_streams);
const initialStates = resourceNames.map(stream => ({
stream,
nextPage:null,
since: startTs,
until: endTs,
poll_interval_sec: 1
}));
const initialStates = resourceNames
.filter(stream => stream && stream.trim() !== "") // Filter out empty or invalid values
.map(stream => ({
stream,
nextPage: null,
since: startTs,
until: endTs,
poll_interval_sec: 1
}));
return callback(null, initialStates, 1);
}

Expand Down

0 comments on commit 8448ab8

Please sign in to comment.