mirror of https://github.com/langgenius/dify.git
fix(api): StreamsBroadcastChannel start reading messages from the end
Setting initial `_last_id` to `0-0` would causing every subscription to receive one copy of the event stream, which is not compatible with the current frontend / backend communication protocol.
This commit is contained in:
parent
0c3d11f920
commit
7c207327e3
|
|
@ -64,7 +64,10 @@ class _StreamsSubscription(Subscription):
|
|||
self._client = client
|
||||
self._key = key
|
||||
self._closed = threading.Event()
|
||||
self._last_id = "0-0"
|
||||
# Setting initial last id to `$` to signal redis that we only want new messages.
|
||||
#
|
||||
# ref: https://redis.io/docs/latest/commands/xread/#the-special--id
|
||||
self._last_id = "$"
|
||||
self._queue: queue.Queue[object] = queue.Queue()
|
||||
self._start_lock = threading.Lock()
|
||||
self._listener: threading.Thread | None = None
|
||||
|
|
|
|||
Loading…
Reference in New Issue