mirror of https://github.com/nicolargo/glances.git
Something in 4.3.2 broke the home assistant add-on for Glances #3238
This commit is contained in:
parent
b340b5fc30
commit
e3bbd0dc2a
|
|
@ -19,7 +19,7 @@ import tracemalloc
|
|||
# Global name
|
||||
# Version should start and end with a numerical char
|
||||
# See https://packaging.python.org/specifications/core-metadata/#version
|
||||
__version__ = "4.4.0_dev0"
|
||||
__version__ = "4.3.3"
|
||||
__apiversion__ = '4'
|
||||
__author__ = 'Nicolas Hennion <nicolas@nicolargo.com>'
|
||||
__license__ = 'LGPLv3'
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ from urllib.parse import urljoin
|
|||
|
||||
from glances import __apiversion__, __version__
|
||||
from glances.events_list import glances_events
|
||||
from glances.globals import json_dumps, weak_lru_cache
|
||||
from glances.globals import json_dumps
|
||||
from glances.logger import logger
|
||||
from glances.password import GlancesPassword
|
||||
from glances.processes import glances_processes
|
||||
|
|
@ -457,7 +457,6 @@ class GlancesRestfulApi:
|
|||
return GlancesJSONResponse(self.servers_list.get_servers_list() if self.servers_list else [])
|
||||
|
||||
# Comment this solve an issue on Home Assistant See #3238
|
||||
# @weak_lru_cache(maxsize=1, ttl=1)
|
||||
def _api_all(self):
|
||||
"""Glances API RESTful implementation.
|
||||
|
||||
|
|
@ -486,7 +485,6 @@ class GlancesRestfulApi:
|
|||
|
||||
return GlancesJSONResponse(statval)
|
||||
|
||||
@weak_lru_cache(maxsize=1, ttl=1)
|
||||
def _api_all_limits(self):
|
||||
"""Glances API RESTful implementation.
|
||||
|
||||
|
|
@ -503,7 +501,6 @@ class GlancesRestfulApi:
|
|||
|
||||
return GlancesJSONResponse(limits)
|
||||
|
||||
@weak_lru_cache(maxsize=1, ttl=1)
|
||||
def _api_all_views(self):
|
||||
"""Glances API RESTful implementation.
|
||||
|
||||
|
|
@ -520,7 +517,6 @@ class GlancesRestfulApi:
|
|||
|
||||
return GlancesJSONResponse(limits)
|
||||
|
||||
@weak_lru_cache(maxsize=1, ttl=1)
|
||||
def _api(self, plugin: str):
|
||||
"""Glances API RESTful implementation.
|
||||
|
||||
|
|
@ -550,7 +546,6 @@ class GlancesRestfulApi:
|
|||
status.HTTP_400_BAD_REQUEST, f"Unknown plugin {plugin} (available plugins: {self.plugins_list})"
|
||||
)
|
||||
|
||||
@weak_lru_cache(maxsize=1, ttl=1)
|
||||
def _api_top(self, plugin: str, nb: int = 0):
|
||||
"""Glances API RESTful implementation.
|
||||
|
||||
|
|
@ -578,7 +573,6 @@ class GlancesRestfulApi:
|
|||
|
||||
return GlancesJSONResponse(statval)
|
||||
|
||||
@weak_lru_cache(maxsize=1, ttl=1)
|
||||
def _api_history(self, plugin: str, nb: int = 0):
|
||||
"""Glances API RESTful implementation.
|
||||
|
||||
|
|
@ -601,7 +595,6 @@ class GlancesRestfulApi:
|
|||
|
||||
return statval
|
||||
|
||||
@weak_lru_cache(maxsize=1, ttl=1)
|
||||
def _api_limits(self, plugin: str):
|
||||
"""Glances API RESTful implementation.
|
||||
|
||||
|
|
@ -620,7 +613,6 @@ class GlancesRestfulApi:
|
|||
|
||||
return GlancesJSONResponse(ret)
|
||||
|
||||
@weak_lru_cache(maxsize=1, ttl=1)
|
||||
def _api_views(self, plugin: str):
|
||||
"""Glances API RESTful implementation.
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import threading
|
|||
import traceback
|
||||
from importlib import import_module
|
||||
|
||||
from glances.globals import exports_path, plugins_path, sys_path
|
||||
from glances.globals import exports_path, plugins_path, sys_path, weak_lru_cache
|
||||
from glances.logger import logger
|
||||
from glances.timer import Counter
|
||||
|
||||
|
|
@ -266,6 +266,7 @@ please rename it to "{plugin_path.capitalize()}Plugin"'
|
|||
for p in self.getPluginsList(enable=False):
|
||||
self._plugins[p].load_limits(config)
|
||||
|
||||
@weak_lru_cache(maxsize=1, ttl=1)
|
||||
def __update_plugin(self, p):
|
||||
"""Update stats, history and views for the given plugin name p"""
|
||||
self._plugins[p].update()
|
||||
|
|
|
|||
Loading…
Reference in New Issue