elixir-geolix / geolix

IP information lookup provider
Apache License 2.0
190 stars 18 forks source link

Doing twice the same lookup give different results #27

Closed ook closed 5 years ago

ook commented 5 years ago

I'm using a paid maxmind account to fetch the up to date country code from IP. I notice that I have many nil for some hundred of IPs, but when I retry the lookup just some lines after, the lookup give "positive" results. How is it possible? Does the Worker can crash and GenServer return nil "by default" ? How could I test this? (I get the same behavior with 0.17, 0.18 and master)

mneudert commented 5 years ago

The only case I can think of right now would be an effect of the asynchronous loading process (it will be possible in the next release to force the database to be loaded synchronously during startup).

If you are able to reproduce the behaviour you could check if for a difference between Geolix.Database.Loader.loaded_databases/0 and Geolix.Database.Loader.registered_databases/0. Having a database not fully loaded could explain the results you see.

ook commented 5 years ago

Thanks to the metadata feature, I proofed there's a rogue DB version in the distillery release. I guess we can close. Thank you.