MCPcopy Create free account
hub / github.com/ecto/muni / flush

Method flush

depot/console/src/lib/errorTracking.ts:83–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81 }
82
83 private async flush() {
84 if (this.buffer.length === 0) return;
85 const events = [...this.buffer];
86 this.buffer = [];
87
88 try {
89 // POST to console backend error endpoint
90 await fetch("/api/errors", {
91 method: "POST",
92 headers: { "Content-Type": "application/json" },
93 body: JSON.stringify({ events }),
94 });
95 } catch {
96 // If reporting fails, put events back (up to a limit)
97 if (this.buffer.length < 100) {
98 this.buffer.unshift(...events);
99 }
100 }
101 }
102
103 startPeriodicFlush(intervalMs = 30_000) {
104 this.flushInterval = window.setInterval(() => this.flush(), intervalMs);

Callers 7

captureMethod · 0.95
startPeriodicFlushMethod · 0.95
__wbg_get_importsFunction · 0.80
write_poses_csvFunction · 0.80
write_pcdFunction · 0.80
send_ubx_cfgFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected