Fixed counter

This commit is contained in:
DomySh
2022-07-08 12:04:52 +02:00
parent 74e3e832b3
commit 646c1844b1
2 changed files with 7 additions and 8 deletions

View File

@@ -176,9 +176,11 @@ class ProxyManager:
self.db = db
self.proxy_table: Dict[ServiceManager] = {}
self.lock = asyncio.Lock()
self.updater_task = None
def init_updater(self):
asyncio.create_task(self._stats_updater())
if not self.updater_task:
self.updater_task = asyncio.create_task(self._stats_updater())
async def close(self):
for key in list(self.proxy_table.keys()):
@@ -202,7 +204,6 @@ class ProxyManager:
async def _stats_updater(self):
while True:
print("ALIVE!")
try:
for key in list(self.proxy_table.keys()):
self.proxy_table[key].update_stats()