1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

17 lines
371 B
Python
Raw Normal View History

2020-01-21 17:27:57 -07:00
"""API Events."""
2020-04-16 00:27:00 -07:00
# Project
from hyperglass.cache import AsyncCache
2020-04-16 00:27:00 -07:00
from hyperglass.configuration import REDIS_CONFIG, params
async def check_redis() -> bool:
"""Ensure Redis is running before starting server."""
cache = AsyncCache(db=params.cache.database, **REDIS_CONFIG)
await cache.test()
2020-04-16 00:27:00 -07:00
return True
on_startup = (check_redis,)
2020-04-16 00:27:00 -07:00
on_shutdown = ()