Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

fix(buffer): dont save bot events when testing

Carl-Gerhard Lindesvärdde1a4faf28f8
diff --git a/packages/db/src/buffers/bot-buffer-psql.ts b/packages/db/src/buffers/bot-buffer-psql.ts
index d9d67332f..0f153ecee 100644
--- a/packages/db/src/buffers/bot-buffer-psql.ts
+++ b/packages/db/src/buffers/bot-buffer-psql.ts
@@ -39,7 +39,7 @@ export class BotBuffer extends BaseBuffer {
},
});
- if (unprocessedCount >= this.batchSize) {
+ if (unprocessedCount >= this.batchSize && !process.env.TEST_NEW_BUFFER) {
await this.tryFlush();
}
} catch (error) {