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

Commit

Permalink
Merge pull request #311 from segmentio/pj/change_flush_limit
Browse files Browse the repository at this point in the history
Flush when approaching the limit instead of surpassing the limit
  • Loading branch information
pooyaj committed Nov 19, 2021
2 parents 70f24fe + da8ddfe commit b9db143
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -47,7 +47,7 @@ class Analytics {
this.axiosInstance = axiosInstance
this.timeout = options.timeout || false
this.flushAt = Math.max(options.flushAt, 1) || 20
this.maxQueueSize = options.maxQueueSize || 1024 * 500 // defaults to 500kb
this.maxQueueSize = options.maxQueueSize || 1024 * 450 // 500kb is the API limit, if we approach the limit i.e., 450kb, we'll flush
this.flushInterval = options.flushInterval || 10000
this.flushed = false
Object.defineProperty(this, 'enable', {
Expand Down

0 comments on commit b9db143

Please sign in to comment.