mirror of
https://github.com/thatmattlove/hyperglass.git
synced 2026-01-17 08:48:05 +00:00
14 lines
257 B
Python
14 lines
257 B
Python
"""API Events."""
|
|
|
|
# Project
|
|
from hyperglass.state import use_state
|
|
|
|
|
|
def check_redis() -> bool:
|
|
"""Ensure Redis is running before starting server."""
|
|
state = use_state()
|
|
return state._redis.ping()
|
|
|
|
|
|
on_startup = (check_redis,)
|
|
on_shutdown = ()
|