mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 21:04:31 +00:00
refactor(plugin-sdk): unify channel dedupe primitives
This commit is contained in:
@@ -227,5 +227,13 @@ describe("infra store", () => {
|
||||
expect(cache.check("c", 200)).toBe(false);
|
||||
expect(cache.size()).toBe(2);
|
||||
});
|
||||
|
||||
it("supports non-mutating existence checks via peek()", () => {
|
||||
const cache = createDedupeCache({ ttlMs: 1000, maxSize: 10 });
|
||||
expect(cache.peek("a", 100)).toBe(false);
|
||||
expect(cache.check("a", 100)).toBe(false);
|
||||
expect(cache.peek("a", 200)).toBe(true);
|
||||
expect(cache.peek("a", 1201)).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user