diff options
author | Andrej Shadura <andrewsh@debian.org> | 2022-01-25 17:19:30 +0100 |
---|---|---|
committer | Andrej Shadura <andrewsh@debian.org> | 2022-01-25 17:19:30 +0100 |
commit | 0027c02b907486b437772b1cdecbea14d18597d9 (patch) | |
tree | 2d229de4d40a5dcd53d1981b34953a4862203e04 /synapse/storage/util | |
parent | d3d4fbf0a1d394c3e39184fbe0348d6b1d8c7219 (diff) |
New upstream version 1.51.0
Diffstat (limited to 'synapse/storage/util')
-rw-r--r-- | synapse/storage/util/id_generators.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/storage/util/id_generators.py b/synapse/storage/util/id_generators.py index b8112e1c..3c13859f 100644 --- a/synapse/storage/util/id_generators.py +++ b/synapse/storage/util/id_generators.py @@ -762,13 +762,13 @@ class _AsyncCtxManagerWrapper(Generic[T]): return self.inner.__exit__(exc_type, exc, tb) -@attr.s(slots=True) +@attr.s(slots=True, auto_attribs=True) class _MultiWriterCtxManager: """Async context manager returned by MultiWriterIdGenerator""" - id_gen = attr.ib(type=MultiWriterIdGenerator) - multiple_ids = attr.ib(type=Optional[int], default=None) - stream_ids = attr.ib(type=List[int], factory=list) + id_gen: MultiWriterIdGenerator + multiple_ids: Optional[int] = None + stream_ids: List[int] = attr.Factory(list) async def __aenter__(self) -> Union[int, List[int]]: # It's safe to run this in autocommit mode as fetching values from a |