Using the apscheduler library for running background metrics calculations
- Using apscheduler library for background job for metrics calculations.
- Separating caching and scheduling logic.
- Adding an edge case for route handling when metrics are not ready yet (which means only allowing write to the scheduled thread and not the main thread; getting rid of the lazy evaluation for _set_cache).