bug: geo scheduler fails if no locations
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Geo scheduler fails when no items in database:
```
[Nest] 21736 - 03/07/2024, 11:00:00 AM DEBUG [MetricsSchedulerService] No prometheus queries in database...
[Nest] 21736 - 03/07/2024, 11:00:00 AM DEBUG [SchedulerService] No neighborhoods in database...
[Nest] 21736 - 03/07/2024, 11:00:00 AM DEBUG [GeoUpdater] Seeding geolcations...
[Nest] 21736 - 03/07/2024, 11:00:00 AM LOG [GeoUpdater] Error happened while updating geolocation:
TypeError: Cannot read properties of null (reading 'name')
at GeoUpdater.seedLocationValues (/Users/justingriffin/git/lifted/many-product/talib/server/src/services/geo-scheduler/geo-updater/updater.ts:134:34)
at GeoUpdater.run (/Users/justingriffin/git/lifted/many-product/talib/server/src/services/geo-scheduler/geo-updater/updater.ts:214:18)
at GeoSchedulerService.updateLocations (/Users/justingriffin/git/lifted/many-product/talib/server/src/services/geo-scheduler/geo-scheduler.service.ts:68:15)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at GeoSchedulerService.run (/Users/justingriffin/git/lifted/many-product/talib/server/src/services/geo-scheduler/geo-scheduler.service.ts:44:9)
```
**To Reproduce**
Steps to reproduce the behavior:
1. Delete all data in the database
2. Run the server
**Expected behavior**
Should log an info message `No locations in database...` after checking before attempting to run
Contributor guide
Assessment
This issue has not been assessed yet.