Add ability to shard the federation sender (#7798)

This commit is contained in:
Erik Johnston 2020-07-10 18:26:36 +01:00 committed by GitHub
parent f1245dc3c0
commit f299441cc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 670 additions and 157 deletions

View file

@ -293,20 +293,22 @@ class FederationAckCommand(Command):
Format::
FEDERATION_ACK <token>
FEDERATION_ACK <instance_name> <token>
"""
NAME = "FEDERATION_ACK"
def __init__(self, token):
def __init__(self, instance_name, token):
self.instance_name = instance_name
self.token = token
@classmethod
def from_line(cls, line):
return cls(int(line))
instance_name, token = line.split(" ")
return cls(instance_name, int(token))
def to_line(self):
return str(self.token)
return "%s %s" % (self.instance_name, self.token)
class RemovePusherCommand(Command):