Scheduler

Overview

The Scheduler is a system that runs tasks either at a certain time or a certain interval. It is separate from the API but shares the same database and models.

Events

The main function of the Scheduler is turning games on and off. It does this by checking every minute to see if there are games that have started that are not live, or games that have ended that are.

When the Scheduler turns a game on, it also loads the payload for each tag into the Cache. Likewise, when a game ends, the Schedule clears the Cache for those tags.

Another function of the Scheduler is to save all the scans that are loaded into the Queue. Scans are pushed to the Queue to avoid saving them individually in real-time. Instead, all the queued scans are saved in batches by the Scheduler.

Current Tasks

Name
Interval
Description
isActive

Parse Roster

EVERY_DAY

Pulls the latest rosters from SportsRadar

Parse Events

EVERY_MINUTE

Pulls the latest statistics from SportsRadar for each live event

Parse Schedule

EVERY_DAY

Pulls the latest schedule from SportsRadar

Last updated