szmarczak / cacheable-lookup

A cacheable dns.lookup(…) that respects TTL :tada:
MIT License
193 stars 29 forks source link

Fix promise not being removed from queue on fallback query #34

Closed Karacala closed 3 years ago

Karacala commented 3 years ago

Always delete entries from _pending when promise is resolved

In the queryAndCache function, _pending entries are deleted at return but not in fallback mode. So in fallback mode, _dnsLookup is called only once. Thus, name resolution remains in an old state.

Add a test for demonstration.

szmarczak commented 3 years ago

Nice catch! Thank you :tada:

szmarczak commented 3 years ago

Released 5.0.4.

Karacala commented 3 years ago

Thanks And thanks for your reactivity