joao-fontenele / stable-cache

A redis cache library, with producer resilience easily configurable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: circuit breaker close events aren't being triggered correctly

joao-fontenele opened this issue · comments

I believe it's due to the fact that onReset event listeners are cleaned up after the producer promise finishes

listeners setup: https://github.com/joao-fontenele/simple-cache/blob/adcc2ae2768b5789bf0c352a76566245628ac947/lib/classes/producer.js#L41-L43
listerners cleanup: https://github.com/joao-fontenele/simple-cache/blob/adcc2ae2768b5789bf0c352a76566245628ac947/lib/classes/producer.js#L90-L91

one possible solution is to move policy creation and listening to the level of the cache class