Opened 9 months ago

Closed 9 months 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 (6)

comment:1 by Nick Pope, 9 months ago

Has patch: set

comment:2 by Mariusz Felisiak, 9 months ago

Triage Stage: UnreviewedAccepted

Tentatively accepted.

Last edited 9 months ago by Mariusz Felisiak (previous) (diff)

comment:3 by Mariusz Felisiak, 9 months ago

Patch needs improvement: set

comment:4 by Nick Pope, 9 months ago

Patch needs improvement: unset

Rebased and fixed tests after #35092.

comment:5 by Mariusz Felisiak, 9 months ago

Triage Stage: AcceptedReady for checkin

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

Resolution: fixed
Status: assignedclosed

In 40b5b15:

Fixed #35100 -- Reworked GeoIP2 database initialization.

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