From ae01a7edd32c8a4650700294c50a37385fa07984 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Wed, 6 Apr 2022 13:59:04 +0100 Subject: Update type annotations for compatiblity with prometheus_client 0.14 (#12389) Principally, `prometheus_client.REGISTRY.register` now requires its argument to extend `prometheus_client.Collector`. Additionally, `Gauge.set` is now annotated so that passing `Optional[int]` causes an error. --- synapse/storage/databases/main/events.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'synapse/storage/databases/main') diff --git a/synapse/storage/databases/main/events.py b/synapse/storage/databases/main/events.py index d253243125..57489c30f1 100644 --- a/synapse/storage/databases/main/events.py +++ b/synapse/storage/databases/main/events.py @@ -200,9 +200,7 @@ class PersistEventsStore: if stream < 0: # backfilled events have negative stream orderings, so we don't # want to set the event_persisted_position to that. - synapse.metrics.event_persisted_position.set( - events_and_contexts[-1][0].internal_metadata.stream_ordering - ) + synapse.metrics.event_persisted_position.set(stream) for event, context in events_and_contexts: if context.app_service: -- cgit 1.4.1