Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit da8ddfe

Browse files
committed
flush when approaching the limit instead of surpassing the limit
1 parent 70f24fe commit da8ddfe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Analytics {
4747
this.axiosInstance = axiosInstance
4848
this.timeout = options.timeout || false
4949
this.flushAt = Math.max(options.flushAt, 1) || 20
50-
this.maxQueueSize = options.maxQueueSize || 1024 * 500 // defaults to 500kb
50+
this.maxQueueSize = options.maxQueueSize || 1024 * 450 // 500kb is the API limit, if we approach the limit i.e., 450kb, we'll flush
5151
this.flushInterval = options.flushInterval || 10000
5252
this.flushed = false
5353
Object.defineProperty(this, 'enable', {

0 commit comments

Comments
 (0)