-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
geoip2: watch and update #128
Conversation
@abh - made both changes per your recommendations. Let me know if you have additional feedback. |
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). |
bug: read lock missing from GetLocation GetLocation operates on a *geoip2.City (pointer) but does not incur a read-lock on the GeoIP struct like other functions.
@abh the latest update:
I have tested these operations locally and have verified each of my statements above. I look forward to your feedback. |
Per feedback in PR #424, change functions `open`, `New`, and the GeoIP2 struct to allow for independent lock management, update the file in-place if `open` is called again, and remove enums and other references in the package.
Add checks for the DB to be active before making a query. This was only enabled on ASN, now enabled for City and Country queries.
I forgot that the |
Thank you again for all this. The last days were busy; but I'll give it a look and get it merged soon! |
@abh bumping this for review. 😄 |
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. |
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