refactor(sofiia-console): extract idempotency store abstraction
Move idempotency TTL/LRU logic into a dedicated store module with a swap-ready interface and wire chat send flow to use store get/set semantics without changing API behavior. Made-with: Cursor
This commit is contained in:
@@ -28,12 +28,16 @@ def sofiia_module(tmp_path, monkeypatch):
|
||||
asyncio.set_event_loop(loop)
|
||||
|
||||
import app.db as db_mod # type: ignore
|
||||
import app.idempotency as idem_mod # type: ignore
|
||||
import app.main as main_mod # type: ignore
|
||||
|
||||
importlib.reload(db_mod)
|
||||
importlib.reload(idem_mod)
|
||||
importlib.reload(main_mod)
|
||||
main_mod._rate_buckets.clear()
|
||||
main_mod._idempotency_cache.clear()
|
||||
store = idem_mod.get_idempotency_store()
|
||||
if hasattr(store, "reset"):
|
||||
store.reset()
|
||||
return main_mod
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user