Skip to content

bug: geo scheduler fails if no locations #294

@jgryffindor

Description

@jgryffindor

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions