summary refs log tree commit diff
path: root/synapse/federation/sender/per_destination_queue.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-04-29 16:41:04 +0100
committerErik Johnston <erik@matrix.org>2021-04-29 16:41:04 +0100
commit4a3a9597f500fe62a4ab4dd2af966ee704fbea02 (patch)
treeba0f7c76e176dc7c427798cca2fabc27f7af57e5 /synapse/federation/sender/per_destination_queue.py
parentNewsfile (diff)
parentMerge tag 'v1.33.0rc2' into develop (diff)
downloadsynapse-4a3a9597f500fe62a4ab4dd2af966ee704fbea02.tar.xz
Merge remote-tracking branch 'origin/develop' into erikj/test_send
Diffstat (limited to 'synapse/federation/sender/per_destination_queue.py')
-rw-r--r--synapse/federation/sender/per_destination_queue.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/synapse/federation/sender/per_destination_queue.py b/synapse/federation/sender/per_destination_queue.py

index 3bb66bce32..3b053ebcfb 100644 --- a/synapse/federation/sender/per_destination_queue.py +++ b/synapse/federation/sender/per_destination_queue.py
@@ -154,22 +154,19 @@ class PerDestinationQueue: + len(self._pending_edus_keyed) ) - def send_pdus(self, pdus: Iterable[EventBase]) -> None: - """Add PDUs to the queue, and start the transmission loop if necessary + def send_pdu(self, pdu: EventBase) -> None: + """Add a PDU to the queue, and start the transmission loop if necessary Args: - pdus: pdus to send + pdu: pdu to send """ if not self._catching_up or self._last_successful_stream_ordering is None: # only enqueue the PDU if we are not catching up (False) or do not # yet know if we have anything to catch up (None) - self._pending_pdus.extend(pdus) + self._pending_pdus.append(pdu) else: - self._catchup_last_skipped = max( - pdu.internal_metadata.stream_ordering - for pdu in pdus - if pdu.internal_metadata.stream_ordering is not None - ) + assert pdu.internal_metadata.stream_ordering + self._catchup_last_skipped = pdu.internal_metadata.stream_ordering self.attempt_new_transaction()