liftedinit / liftedinit/talib

bug: geo scheduler fails if no locations

Open
#294 0 comments 0 reactions 1 assignee Claimed by @jgryffindor View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.