From 9ffcfbc9cead857c988943ce51a0ee1f9584672d Mon Sep 17 00:00:00 2001 From: Stefan Allius Date: Sun, 22 Sep 2024 10:42:48 +0200 Subject: [PATCH] declare more methods as classmethods --- app/src/infos.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/infos.py b/app/src/infos.py index e06348e..4a17a77 100644 --- a/app/src/infos.py +++ b/app/src/infos.py @@ -378,14 +378,16 @@ class Infos: return None # unknwon idx, not in info_defs - def inc_counter(self, counter: str) -> None: + @classmethod + def inc_counter(cls, counter: str) -> None: '''inc proxy statistic counter''' - db_dict = self.stat['proxy'] + db_dict = cls.stat['proxy'] db_dict[counter] += 1 - def dec_counter(self, counter: str) -> None: + @classmethod + def dec_counter(cls, counter: str) -> None: '''dec proxy statistic counter''' - db_dict = self.stat['proxy'] + db_dict = cls.stat['proxy'] db_dict[counter] -= 1 def ha_proxy_confs(self, ha_prfx: str, node_id: str, snr: str) \