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