Skip to content

Commit

Permalink
fix(utils): use cache in get_bibtex_from_url
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Aug 21, 2024
1 parent 09049fe commit 180fc93
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apis_bibsonomy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from django.conf import settings
import json
import logging
from functools import cache

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -58,6 +59,7 @@ def get_autocomplete(self):
autocomplete = property(get_autocomplete)


@cache
def get_bibtex_from_url(url):
sources = getattr(settings, "APIS_BIBSONOMY", [])
sources = [s for s in sources if s.get("url") and s.get("url") in url]
Expand Down

0 comments on commit 180fc93

Please sign in to comment.