Skip to content

Commit 92169fd

Browse files
abueideclaude
andcommitted
refactor: remove unnecessary return Promise.resolve() in async sendEvents
Async functions implicitly return Promise<undefined>; explicit Promise.resolve() is redundant. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 316faed commit 92169fd

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

packages/core/src/plugins/SegmentDestination.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export class SegmentDestination extends DestinationPlugin {
199199

200200
private sendEvents = async (events: SegmentEvent[]): Promise<void> => {
201201
if (events.length === 0) {
202-
return Promise.resolve();
202+
return;
203203
}
204204

205205
// We're not sending events until Segment has loaded all settings
@@ -235,7 +235,7 @@ export class SegmentDestination extends DestinationPlugin {
235235
events = freshEvents;
236236

237237
if (events.length === 0) {
238-
return Promise.resolve();
238+
return;
239239
}
240240
}
241241

@@ -316,8 +316,6 @@ export class SegmentDestination extends DestinationPlugin {
316316
`${failedCount} events will retry (429: ${aggregation.has429}, transient: ${aggregation.hasTransientError})`
317317
);
318318
}
319-
320-
return Promise.resolve();
321319
};
322320

323321
private readonly queuePlugin = new QueueFlushingPlugin(this.sendEvents);

0 commit comments

Comments
 (0)