mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
add tests for write coalescer
This commit is contained in:
@@ -150,4 +150,13 @@ async function flushAll() {
|
||||
await Promise.race([Promise.allSettled(writes), timeout]);
|
||||
}
|
||||
|
||||
module.exports = { writeCoalesced, getPending, flushAll };
|
||||
// Test-only: clear all internal state. Not exported for production use.
|
||||
function _reset() {
|
||||
for (const entry of pending.values()) {
|
||||
clearTimeout(entry.timer);
|
||||
}
|
||||
pending.clear();
|
||||
lastWriteTime.clear();
|
||||
}
|
||||
|
||||
module.exports = { writeCoalesced, getPending, flushAll, _reset };
|
||||
|
||||
Reference in New Issue
Block a user