diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-05-22 10:50:26 -0500 |
---|---|---|
committer | Amber Brown <hawkowl@atleastfornow.net> | 2018-05-22 10:50:26 -0500 |
commit | a8990fa2ec98ea14493515a92d6228729024409b (patch) | |
tree | a0ce94c793d02e80ac95ec43a16c3b11a1884efa /synapse/metrics | |
parent | rest of the changes (diff) | |
parent | Merge pull request #3262 from matrix-org/rav/has_already_consented (diff) | |
download | synapse-a8990fa2ec98ea14493515a92d6228729024409b.tar.xz |
Merge remote-tracking branch 'origin/develop' into 3218-official-prom
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) |