From 13a62d134561c958451549ab44b7af4833c75858 Mon Sep 17 00:00:00 2001 From: Robert Latta <robert.latta@geant.org> Date: Wed, 28 Apr 2021 09:23:38 +0000 Subject: [PATCH] locally cached equipment_name --- inventory_provider/routes/classifier.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inventory_provider/routes/classifier.py b/inventory_provider/routes/classifier.py index 6c3d4386..027a47bf 100644 --- a/inventory_provider/routes/classifier.py +++ b/inventory_provider/routes/classifier.py @@ -2,6 +2,7 @@ import ipaddress import json import logging import re +from functools import lru_cache from typing import Optional from flask import Blueprint, Response, request @@ -102,6 +103,7 @@ def after_request(resp): return common.after_request(resp) +@lru_cache(256) def get_ims_equipment_name(equipment_name: str, r: Redis=None) -> str: if not r: r = common.get_current_redis() -- GitLab