mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
Fix dictionary changed size during iteration in prometheus (#115005)
Fixes #104803
This commit is contained in:
parent
e85b9faa00
commit
7d5b39b9de
@ -257,7 +257,7 @@ class PrometheusMetrics:
|
||||
self, entity_id: str, friendly_name: str | None = None
|
||||
) -> None:
|
||||
"""Remove labelsets matching the given entity id from all metrics."""
|
||||
for metric in self._metrics.values():
|
||||
for metric in list(self._metrics.values()):
|
||||
for sample in cast(list[prometheus_client.Metric], metric.collect())[
|
||||
0
|
||||
].samples:
|
||||
|
Loading…
x
Reference in New Issue
Block a user