MCPcopy
hub / github.com/streetwriters/notesnook / flush

Method flush

packages/core/src/logger.ts:117–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115 }
116
117 async flush() {
118 if (this.queue.length === 0) return;
119 const queueCopy = this.queue.slice();
120 this.queue = [];
121 for (const chunk of toChunks(queueCopy, 1000)) {
122 await this.db.insertInto("logs").values(chunk).execute();
123 }
124 }
125
126 async rotate() {
127 const range = Date.now() - WEEK;

Callers 1

constructorMethod · 0.95

Calls 4

toChunksFunction · 0.85
sliceMethod · 0.80
valuesMethod · 0.65
executeMethod · 0.45

Tested by

no test coverage detected