Update where the stream marker gets set to avoid the possibility of duplicate messages during the transition.

This commit is contained in:
Morgan McMillian 2018-03-25 13:10:22 -07:00
parent 66c7acb36d
commit 0e93f9cd5d

View file

@ -196,10 +196,12 @@ class ChannelMonitor(threading.Thread):
# update the last message id # update the last message id
if len(messages) > 0: if len(messages) > 0:
room.pnut_since = messages[0].id room.pnut_since = messages[0].id
if 'max_id' in meta:
self.update_marker(room.pnut_chan, meta.max_id)
db.session.commit() db.session.commit()
# update the stream marker
if 'max_id' in meta:
self.update_marker(room.pnut_chan, meta.max_id)
# empty the queue to the matrix room # empty the queue to the matrix room
for item in pqueue: for item in pqueue:
self.txId += 1 self.txId += 1