Skip to content

Commit

Permalink
Remove lru_cache from filebeat secret => s/n
Browse files Browse the repository at this point in the history
Have to build it in a better way.
  • Loading branch information
np5 committed Jun 11, 2019
1 parent 12f4804 commit 5a193a7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions zentral/contrib/filebeat/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from functools import lru_cache
import json
import logging
from zentral.utils.certificates import parse_dn
Expand All @@ -8,8 +7,8 @@
logger = logging.getLogger("zentral.contrib.filebeat.utils")


@lru_cache(maxsize=32)
def get_serial_number_from_enrollment_secret(secret):
# TODO optimization. Could be cached. With encrypted communications to the cache server (like with the DB) !
try:
return (EnrollmentSession.objects.select_related("enrollment_secret")
.get(enrollment_secret__secret=secret)
Expand Down

0 comments on commit 5a193a7

Please sign in to comment.