run isort

This commit is contained in:
Amber Brown 2018-07-09 16:09:20 +10:00
parent 2ee9f1bd1a
commit 49af402019
334 changed files with 1749 additions and 1668 deletions

View file

@ -15,17 +15,20 @@
"""A replication client for use by synapse workers.
"""
import logging
from twisted.internet import defer
from twisted.internet.protocol import ReconnectingClientFactory
from .commands import (
FederationAckCommand, UserSyncCommand, RemovePusherCommand, InvalidateCacheCommand,
FederationAckCommand,
InvalidateCacheCommand,
RemovePusherCommand,
UserIpCommand,
UserSyncCommand,
)
from .protocol import ClientReplicationStreamProtocol
import logging
logger = logging.getLogger(__name__)

View file

@ -49,29 +49,37 @@ indicate which side is sending, these are *not* included on the wire::
* connection closed by server *
"""
import fcntl
import logging
import struct
from collections import defaultdict
from six import iteritems, iterkeys
from prometheus_client import Counter
from twisted.internet import defer
from twisted.protocols.basic import LineOnlyReceiver
from twisted.python.failure import Failure
from .commands import (
COMMAND_MAP, VALID_CLIENT_COMMANDS, VALID_SERVER_COMMANDS,
ErrorCommand, ServerCommand, RdataCommand, PositionCommand, PingCommand,
NameCommand, ReplicateCommand, UserSyncCommand, SyncCommand,
)
from .streams import STREAMS_MAP
from synapse.metrics import LaterGauge
from synapse.util.stringutils import random_string
from prometheus_client import Counter
from collections import defaultdict
from six import iterkeys, iteritems
import logging
import struct
import fcntl
from .commands import (
COMMAND_MAP,
VALID_CLIENT_COMMANDS,
VALID_SERVER_COMMANDS,
ErrorCommand,
NameCommand,
PingCommand,
PositionCommand,
RdataCommand,
ReplicateCommand,
ServerCommand,
SyncCommand,
UserSyncCommand,
)
from .streams import STREAMS_MAP
connection_close_counter = Counter(
"synapse_replication_tcp_protocol_close_reason", "", ["reason_type"])

View file

@ -15,19 +15,20 @@
"""The server side of the replication stream.
"""
import logging
from six import itervalues
from prometheus_client import Counter
from twisted.internet import defer
from twisted.internet.protocol import Factory
from .streams import STREAMS_MAP, FederationStream
from .protocol import ServerReplicationStreamProtocol
from synapse.util.metrics import Measure, measure_func
from synapse.metrics import LaterGauge
from synapse.util.metrics import Measure, measure_func
import logging
from prometheus_client import Counter
from six import itervalues
from .protocol import ServerReplicationStreamProtocol
from .streams import STREAMS_MAP, FederationStream
stream_updates_counter = Counter("synapse_replication_tcp_resource_stream_updates",
"", ["stream_name"])

View file

@ -24,11 +24,10 @@ Each stream is defined by the following information:
update_function: The function that returns a list of updates between two tokens
"""
from twisted.internet import defer
import logging
from collections import namedtuple
import logging
from twisted.internet import defer
logger = logging.getLogger(__name__)