Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Remove unused DeviceRow class (#6800)
Browse files Browse the repository at this point in the history
* commit 'a855b7c3a':
  Remove unused DeviceRow class (#6800)
  • Loading branch information
anoadragon453 committed Mar 23, 2020
2 parents fc0fd6e + a855b7c commit 1310c64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
1 change: 1 addition & 0 deletions changelog.d/6800.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix race in federation sender worker that delayed sending of device updates.
21 changes: 1 addition & 20 deletions synapse/federation/send_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,28 +454,9 @@ def add_to_buffer(self, buff):
buff.edus.setdefault(self.edu.destination, []).append(self.edu)


class DeviceRow(BaseFederationRow, namedtuple("DeviceRow", ("destination",))): # str
"""Streams the fact that either a) there is pending to device messages for
users on the remote, or b) a local users device has changed and needs to
be sent to the remote.
"""

TypeId = "d"

@staticmethod
def from_data(data):
return DeviceRow(destination=data["destination"])

def to_data(self):
return {"destination": self.destination}

def add_to_buffer(self, buff):
buff.device_destinations.add(self.destination)


TypeToRow = {
Row.TypeId: Row
for Row in (PresenceRow, PresenceDestinationsRow, KeyedEduRow, EduRow, DeviceRow)
for Row in (PresenceRow, PresenceDestinationsRow, KeyedEduRow, EduRow,)
}


Expand Down

0 comments on commit 1310c64

Please sign in to comment.