mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-07 22:04:58 -04:00
Add type hints to synapse/storage/databases/main/events_worker.py
(#11411)
Also refactor the stream ID trackers/generators a bit and try to document them better.
This commit is contained in:
parent
1d8b80b334
commit
ffd858aa68
13 changed files with 255 additions and 171 deletions
|
@ -13,7 +13,6 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from synapse.replication.slave.storage._slaved_id_tracker import SlavedIdTracker
|
||||
from synapse.replication.tcp.streams import PushRulesStream
|
||||
from synapse.storage.databases.main.push_rule import PushRulesWorkerStore
|
||||
|
||||
|
@ -25,9 +24,6 @@ class SlavedPushRuleStore(SlavedEventStore, PushRulesWorkerStore):
|
|||
return self._push_rules_stream_id_gen.get_current_token()
|
||||
|
||||
def process_replication_rows(self, stream_name, instance_name, token, rows):
|
||||
# We assert this for the benefit of mypy
|
||||
assert isinstance(self._push_rules_stream_id_gen, SlavedIdTracker)
|
||||
|
||||
if stream_name == PushRulesStream.NAME:
|
||||
self._push_rules_stream_id_gen.advance(instance_name, token)
|
||||
for row in rows:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue