abh / geodns

DNS server with per-client targeted responses
Apache License 2.0
1.37k stars 191 forks source link

geoip2: watch and update #128

Closed tydavis closed 2 years ago

tydavis commented 2 years ago

Add goroutine to watch file modification time each minute. Lock and update the files independently if the modification time is newer than the last time it was loaded.

Also ancillary fixes for type signatures, and formatting test files.

Fixes #116, #16

tydavis commented 2 years ago

@abh - made both changes per your recommendations. Let me know if you have additional feedback.

abh commented 2 years ago

Thanks @tydavis! I had two more comments (I forgot how GitHub works and put the comments on the commit, I hope it's not too confusing).

tydavis commented 2 years ago

@abh the latest update:

I have tested these operations locally and have verified each of my statements above. I look forward to your feedback.

tydavis commented 2 years ago

I forgot that the get function would load and error check getting the reader... now we check that the reader is active before querying

abh commented 2 years ago

Thank you again for all this. The last days were busy; but I'll give it a look and get it merged soon!

tydavis commented 2 years ago

@abh bumping this for review. 😄

abh commented 2 years ago

It looks good, thank you again @tydavis! I've merged it and a couple of the pool.ntp.org servers are running the update now.