mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-06-24 05:35:10 +00:00
SSE server reliability improvements
This commit is contained in:
@@ -101,7 +101,7 @@ class APISpotsStreamHandler(tornado_eventsource.handler.EventSourceHandler):
|
||||
self._heartbeat.start()
|
||||
|
||||
# Flush headers immediately so nginx doesn't time out waiting for a response
|
||||
self.write_message(msg="", event="keepalive")
|
||||
self.write_message("keepalive", "")
|
||||
|
||||
except Exception as e:
|
||||
logging.warning("Exception when serving SSE socket", e)
|
||||
@@ -139,7 +139,7 @@ class APISpotsStreamHandler(tornado_eventsource.handler.EventSourceHandler):
|
||||
|
||||
else:
|
||||
# Send a keepalive comment if the queue was empty
|
||||
self.write_message(msg="", event="keepalive")
|
||||
self.write_message("keepalive", "")
|
||||
|
||||
if self._spot_queue not in self._sse_spot_queues:
|
||||
logging.error("Web server cleared up a queue of an active connection!")
|
||||
|
||||
Reference in New Issue
Block a user