diff --git a/invenio.cfg b/invenio.cfg index d70c7556..0f0abe6b 100644 --- a/invenio.cfg +++ b/invenio.cfg @@ -14,7 +14,6 @@ by installer are included here. from copy import deepcopy -from celery.schedules import timedelta from invenio_administration.permissions import administration_permission from invenio_app_rdm.config import CELERY_BEAT_SCHEDULE, APP_RDM_ROUTES, APP_RDM_DEPOSIT_FORM_DEFAULTS as DEPOSIT_FORM_DEFAULTS from invenio_i18n import lazy_gettext as _ diff --git a/site/zenodo_rdm/metrics/api.py b/site/zenodo_rdm/metrics/api.py index b8a396b2..428b6a14 100644 --- a/site/zenodo_rdm/metrics/api.py +++ b/site/zenodo_rdm/metrics/api.py @@ -46,7 +46,10 @@ def get_data_transfer(): download_volume = result.get("download_volume", {}).get("value", 0) search = ( - Search(using=current_search_client, index=build_alias_name("rdmrecords")) + Search( + using=current_search_client, + index=build_alias_name("rdmrecords-records"), + ) .filter("range", created=time_range) .params(request_timeout=120) ) diff --git a/site/zenodo_rdm/metrics/ext.py b/site/zenodo_rdm/metrics/ext.py index b38b922d..11396366 100644 --- a/site/zenodo_rdm/metrics/ext.py +++ b/site/zenodo_rdm/metrics/ext.py @@ -24,7 +24,7 @@ def __init__(self, app=None): def init_config(app): """Initialize configuration.""" for k in dir(config): - if k.startswith("METRICS"): + if k.startswith("METRICS_"): app.config.setdefault(k, getattr(config, k)) def init_app(self, app): diff --git a/site/zenodo_rdm/metrics/utils.py b/site/zenodo_rdm/metrics/utils.py index c5cf7692..13aa0872 100644 --- a/site/zenodo_rdm/metrics/utils.py +++ b/site/zenodo_rdm/metrics/utils.py @@ -40,8 +40,7 @@ def formatted_response(metrics): response = "" for metric in metrics: response += ( - "# HELP {name} {help}\n# TYPE {name} {type}\n{name} " - "{value}\n".format(**metric) - ) + "# HELP {name} {help}\n# TYPE {name} {type}\n{name} " "{value}\n" + ).format(**metric) return response