eastein / mediorc

mediocre irc bot library
2 stars 0 forks source link

dns cache #7

Open jayvdb opened 4 years ago

jayvdb commented 4 years ago

There is are two DNS caches in dnspython. Perhaps use or extend those? https://github.com/rthalley/dnspython/commit/1679c1919b2d59194510ffd739abff3c96c535b1

eastein commented 4 years ago

Patch welcome :)

jayvdb commented 4 years ago

I created https://github.com/jayvdb/dns-cache (also on PyPI) with lots of testing of dnspython itself, and handling of cases that dnspython doesnt support, and is one of the TODOs here at https://github.com/eastein/mediorc/blob/d9a7e8f/mediorc_dns/__init__.py#L10.

That leaves only all_ips as unique and useful code here, and could be implemented generically as client side support and fallback emulation for multi question requests. I would be happy to tackle this if there is any active bots using all_ips, or active bots which would benefit from it. It would be quite interesting to also add limited support for it in the server code of dnspython, e.g. where there is almost no ambiguity.

The only usage I see of all_ips is at https://github.com/eastein/floyd/blob/c155fd2/floyd#L43 , also confirmed by https://github.com/search?l=Python&q=mediorc_dns&type=Code . Is that bot in use still? Any others you are aware of?

I see a few uses of this library at https://github.com/eastein/mediorc/network/dependents?package_id=UGFja2FnZS01MjI5MTgyNg%3D%3D (oddly it omits floyd) - are any of those bots in active use? Are there any active codebases using this library? https://pypistats.org/packages/mediorc suggests there isnt a large userbase.

eastein commented 4 years ago

Hi, I am currently too busy trying to get my local public health department to admit there is a COVID-19 pandemic and react accordingly to read this in more depth. That said, I am a little hesitant (not saying when I have more time I won't be convinced) to add a new dependency to my library for a use case I think is pretty edge casey.

I am pretty sure that these libraries in my github are mostly not used by anyone but me. Perhaps a few people may be running andrey_bot. I do not even run floyd myself anymore. It was built to operate at a hackerspace where I am a member but I rarely visit in person anymore.

The only thing I can really imagine only_ips being used for is within floyd. It was added for the purpose of using it in floyd I believe.

I have got better since I wrote this library at writing docstrings as well, I promise!

jayvdb commented 4 years ago

No worries. I've created an issue in my project about it so I dont forget about it completely as it is quite a common use case, but it will be lower in my priorities since there isnt an active need for it.