Opened 10 months ago

Closed 10 months ago

Last modified 4 weeks ago

#35100 closed Cleanup/optimization (fixed)

Simplify initialization of databases in the GeoIP2 wrapper

Reported by: Nick Pope Owned by: Nick Pope
Component: GIS Version: dev
Severity: Normal Keywords: geoip2
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The initialization of the wrapper around the GeoIP2 databases is overcomplicated and should be simplified.

Currently when calling GeoIP2.city() and GeoIP2.country() the city and country databases will be used respectively, but this is unnecessary as the country database is merely a subset of the city database. It should be possible to provide a path and attempt to open a database from three possible candidates: path, path / city, and path / country. While a minor incompatibility in that the city database may be used instead, this also reduces the potential for mixing data from two different databases where one might be outdated.

Change History (7)

comment:1 by Nick Pope, 10 months ago

Has patch: set

comment:2 by Mariusz Felisiak, 10 months ago

Triage Stage: UnreviewedAccepted
Version 0, edited 10 months ago by Mariusz Felisiak (next)

comment:3 by Mariusz Felisiak, 10 months ago

Patch needs improvement: set

comment:4 by Nick Pope, 10 months ago

Patch needs improvement: unset

Rebased and fixed tests after #35092.

comment:5 by Mariusz Felisiak, 10 months ago

Triage Stage: AcceptedReady for checkin

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 10 months ago

Resolution: fixed
Status: assignedclosed

In 40b5b15:

Fixed #35100 -- Reworked GeoIP2 database initialization.

comment:7 by Claude Paroz, 4 weeks ago

Looks like this fix broke #33442 again.

Note: See TracTickets for help on using tickets.
Back to Top