mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-06 02:21:42 +00:00
Refactor of caching & data storage part 10 #118
This commit is contained in:
@@ -43,6 +43,7 @@ class WebServer:
|
||||
"status": "Starting"
|
||||
}
|
||||
|
||||
def setup(self):
|
||||
# Listen for new spots and alerts being added to the cache, so we can notify SSE clients immediately
|
||||
DATA_STORE.spots.add_listener(self._spot_broadcaster.publish)
|
||||
DATA_STORE.alerts.add_listener(self._alert_broadcaster.publish)
|
||||
@@ -145,3 +146,7 @@ def request_log(handler):
|
||||
f'{handler.get_status()} {request.request_time():.2f}ms | '
|
||||
f'Ref: {referrer} | UA: {user_agent}'
|
||||
)
|
||||
|
||||
|
||||
# Global object
|
||||
WEB_SERVER = WebServer()
|
||||
Reference in New Issue
Block a user