Geocoding Cron Job#76
Merged
tqmsh merged 5 commits intouwblueprint:TQ/geocoding-refresh-cron-jobfrom Jan 12, 2026
Merged
Conversation
- Add route_archive_after field to admin_info table (default: 30 days) - Add geocoded_at field to locations table to track when address was geocoded - Set geocoded_at timestamp when creating locations with coordinates - Create daily cron job to refresh geocoding for locations older than threshold - Fix scheduler service to handle event loop isolation for async jobs - Add database migration for new fields The cron job runs daily at 2 AM and refreshes lat/lon for locations where geocoded_at is NULL or older than route_archive_after days from admin settings.
- Added a new section detailing the automated geocoding refresh cron job. - Included features of the geocoding update, such as automatic refresh and manual trigger. - Added test data instructions and before/after screenshots to illustrate the geocoding process.
tqmsh
requested changes
Jan 12, 2026
backend/python/migrations/versions/6dc0749d4ffd_add_geocoding_refresh_fields.py
Outdated
Show resolved
Hide resolved
- Introduced `_get_archive_threshold`, `_get_locations_to_refresh`, and `_refresh_locations` to modularize the geocoding refresh process. - Updated `refresh_geocoding` to utilize these new functions for improved readability and maintainability. - Removed redundant code and streamlined the process of fetching and refreshing location data.
38f78bb
into
uwblueprint:TQ/geocoding-refresh-cron-job
1 check failed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JIRA ticket link
Geocoding refresh cron job
Implementation description
Geocoding Update
The system includes an automated geocoding refresh cron job that updates location coordinates using the Google Maps Geocoding API.
Features
route_archive_aftersetting in admin_info (default: 30 days)Steps to test
Seed the database with test locations for geocoding:
docker-compose exec backend python -w /app app/seed_geocoding_test_data.pyBefore Update
Locations with NULL coordinates or stale geocoding data:
After Update
Locations with refreshed coordinates from Google Geocoding API:
What should reviewers focus on?
Checklist