Skip to content
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

Expire cached reverse geo data after TTL #447

Closed
jpmens opened this issue Feb 6, 2024 · 1 comment
Closed

Expire cached reverse geo data after TTL #447

jpmens opened this issue Feb 6, 2024 · 1 comment

Comments

@jpmens
Copy link
Member

jpmens commented Feb 6, 2024

When the recorder performs a reverse geo lookup for a particular lat/lon (a.k.a. geohash) combination we store the address (and since recently tzname) in the database.

In the course of time, that address might be invalidated, e.g. a street is renamed. (It's even possible that a time zone is renamed.)

The proposal is to add something like a ttl to the cached data and periodically purge expired entries.

@jpmens
Copy link
Member Author

jpmens commented Feb 6, 2024

It takes less than 1 second to scan through 120,000 records in the lmdb geocache using a cursor in a running recorder, including reading the record and decoding its JSON:

START: 1707256233
COUNT= 120112
END: 1707256233

This would make it feasable to keep it all very simple and, say, perform a scan every 10 or 20 received positions to determine which of the cached entries need purging and purge them.

@jpmens jpmens closed this as completed in 934aaec Feb 18, 2024
jpmens added a commit that referenced this issue Jul 23, 2024
- FIX: add card data to websocket notifications (#450)
- FIX: Enable building when WITH_TZ=no to disable timezone information (#473)
- FIX: view lastpos response (#471)
- FIX: handle out-of-order location notification in last/ (#472)
- FIX: drastically reduce memory leakage in views (#464)
- FIX: reformat json if it contains newlines/tabs before storing in .rec (#437)
- NEW: cached geo records can be auto-expired by setting OTR_CLEAN_AGE (#447)
- NEW: option -J prints variables in JSON format, for scripting
- NEW: version is printed in -J / -V
- FIX: in http mode friends' data must contain a topic; construct it or retrieve from last if available (#451)
- FIX: crash on non-string event name in _transition messages (#454)
- NEW: Add alt field to GeoJSON points parameters (#456)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant