fix(tracker): testing

This commit is contained in:
nick-delirium 2023-04-07 10:32:54 +02:00 committed by Delirium
parent bc5228a931
commit 6c10d55236
2 changed files with 4 additions and 2 deletions

View file

@ -183,7 +183,8 @@ export default class App {
const batch = data.batch
const batchSize = batch.byteLength
console.log(batchSize)
if (batchSize > 1000 * 10) {
// 1000 * 10
if (batchSize > 1) {
gzip(data.batch, { mtime: 0 }, (err, result) => {
if (err) console.error(err)
this.worker?.postMessage({ type: 'compressed', batch: result })

View file

@ -63,10 +63,11 @@ export default class QueueSender {
fetch(this.ingestURL, {
body: batch,
method: 'POST',
// @ts-ignore
headers: {
Authorization: `Bearer ${this.token as string}`,
//"Content-Type": "",
// 'Content-Encoding': isCompressed ? 'gzip' : undefined,
'Content-Encoding': isCompressed ? 'gzip' : undefined,
},
keepalive: batch.length < KEEPALIVE_SIZE_LIMIT,
})