-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_cache.py
39 lines (25 loc) · 1022 Bytes
/
setup_cache.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# .py file for warming up the dashboard cache
import logging
import panel as pn
from core import utils
logger = logging.getLogger('analogs-setup')
logger.setLevel(logging.INFO)
logger.info("Cache warming is starting")
utils.check_version_delete_cache()
logger.info("Loading: config")
config = pn.state.as_cached('config',utils.load_config)
logger.info("Loading: datavars")
datavars = pn.state.as_cached('datavars',utils.load_datavars)
logger.info("Loading: cities")
cities = pn.state.as_cached('cities',utils.load_cities)
logger.info("Loading: places")
places = pn.state.as_cached('places',utils.load_places)
logger.info("Loading: dref")
dref = pn.state.as_cached('dref',utils.load_dref)
logger.info("Loading: dsim")
dsim = pn.state.as_cached('dsim',utils.load_dsim)
logger.info("Loading: density")
density = pn.state.as_cached('density',utils.load_density)
logger.info("Loading: benchmark")
benchmark = pn.state.as_cached('benchmark',utils.load_benchmark)
logger.info("Cache warming done. Setup finished.")