summaryrefslogtreecommitdiff
path: root/searx/openmetrics.py
diff options
context:
space:
mode:
authorBnyro <bnyro@tutanota.com>2024-11-25 16:57:03 +0100
committerGitHub <noreply@github.com>2024-11-25 16:57:03 +0100
commit5bf3fbc93b93cd415e1460877051854c76ae0a28 (patch)
treedfd98b1de30c481c54ff8e090eed74060fc05e05 /searx/openmetrics.py
parentbad070b4bc2c5afa73edea546c68d3e142a476fc (diff)
downloadsearxng-5bf3fbc93b93cd415e1460877051854c76ae0a28.tar.gz
searxng-5bf3fbc93b93cd415e1460877051854c76ae0a28.zip
[fix] openmetrics: value is None if there's no data
Diffstat (limited to 'searx/openmetrics.py')
-rw-r--r--searx/openmetrics.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/searx/openmetrics.py b/searx/openmetrics.py
index 5232e05ca..2cc89839b 100644
--- a/searx/openmetrics.py
+++ b/searx/openmetrics.py
@@ -26,7 +26,7 @@ class OpenMetricsFamily: # pylint: disable=too-few-public-methods
"""
for i, data_info_dict in enumerate(self.data_info):
- if not data_info_dict and data_info_dict != 0:
+ if not data_info_dict or not self.data[i]:
continue
info_representation = ','.join([f"{key}=\"{value}\"" for (key, value) in data_info_dict.items()])