mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-03-17 07:53:08 +00:00
fix: reduce mutation auto-flush threshold from 5 to 2
Lower the auto-flush threshold for workflow mutations from 5 to 2 to ensure more timely data persistence. Since mutations are less frequent than regular telemetry events, a lower threshold provides: - Faster data persistence (don't wait for 5 mutations) - Better testing experience (easier to verify with fewer operations) - Reduced risk of data loss if process exits before threshold - More responsive telemetry for low-volume mutation scenarios This complements the existing 5-second periodic flush and process exit handlers, ensuring mutations are persisted promptly. Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en
This commit is contained in:
BIN
data/nodes.db
BIN
data/nodes.db
Binary file not shown.
@@ -166,9 +166,10 @@ export class TelemetryManager {
|
||||
// Queue for batch processing
|
||||
this.eventTracker.enqueueMutation(mutationRecord);
|
||||
|
||||
// Auto-flush if queue is large
|
||||
// Auto-flush if queue reaches threshold
|
||||
// Lower threshold (2) for mutations since they're less frequent than regular events
|
||||
const queueSize = this.eventTracker.getMutationQueueSize();
|
||||
if (queueSize >= 5) { // Flush after 5 mutations
|
||||
if (queueSize >= 2) {
|
||||
await this.flushMutations();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user