mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-12 07:22:46 -04:00
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.
This commit is contained in:
parent
793d03e2c5
commit
ae01a7edd3
8 changed files with 67 additions and 18 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue