Skip to content

Commit

Permalink
fix: Add GC hint to avoid OOM issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielelpidio committed Nov 15, 2024
1 parent 31e13e5 commit c0feb60
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/js/src/batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,15 @@ export class Batch {
return;
}

const res = await this.ingestFn(this.id, events, this.options);
this.lastFlush = new Date();
let res = null;
try {
res = await this.ingestFn(this.id, events, this.options);
} catch (e) {
throw e;
} finally {
this.lastFlush = new Date();
}

return res;
};
}

0 comments on commit c0feb60

Please sign in to comment.