diff options
Diffstat (limited to 'synapse/metrics')
-rw-r--r-- | synapse/metrics/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py index 973ba6506f..ab0b921497 100644 --- a/synapse/metrics/__init__.py +++ b/synapse/metrics/__init__.py @@ -62,8 +62,12 @@ class LaterGauge(object): yield g - def register(self): + def __attrs_post_init__(self): + self._register() + + def _register(self): if self.name in all_gauges.keys(): + logger.warning("%s already registered, reregistering" % (self.name,)) REGISTRY.unregister(all_gauges.pop(self.name)) REGISTRY.register(self) |