Skip to content

Commit

Permalink
ref: Remove unnecessary eventID check in offline integration (#2890)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-cz authored Sep 14, 2020
1 parent 3f42a01 commit 15465a8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/integrations/src/offline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,11 @@ export class Offline implements Integration {
private async _sendEvents(): Promise<void> {
return this.offlineEventStore.iterate<Event, void>((event: Event, cacheKey: string, _index: number): void => {
if (this.hub) {
const newEventId = this.hub.captureEvent(event);
this.hub.captureEvent(event);

if (newEventId) {
this._purgeEvent(cacheKey).catch((_error): void => {
logger.warn('could not purge event from cache');
});
}
this._purgeEvent(cacheKey).catch((_error): void => {
logger.warn('could not purge event from cache');
});
} else {
logger.warn('no hub found - could not send cached event');
}
Expand Down

0 comments on commit 15465a8

Please sign in to comment.