Skip to content

Commit

Permalink
Merge pull request #75 from PlaidWeb/feature/69-no-cache-instance
Browse files Browse the repository at this point in the history
Don't cache fediverse instance data
  • Loading branch information
fluffy-critter committed Jul 30, 2020
2 parents f636a3c + 5e0e3d5 commit b03c070
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions authl/handlers/fediverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"""

import functools
import logging
import re
import time
Expand Down Expand Up @@ -85,7 +84,6 @@ def __init__(self, name: str,
self._timeout = timeout or 600

@staticmethod
@functools.lru_cache(128)
def _get_instance(url) -> typing.Optional[str]:
parsed = urllib.parse.urlparse(url)
if not parsed.netloc:
Expand Down Expand Up @@ -135,12 +133,12 @@ def handles_url(self, url):

return instance

@functools.lru_cache(128)
def _get_client(self, id_url: str, callback_uri: str) -> typing.Optional['Fediverse._Client']:
""" Get the client data """
instance = self._get_instance(id_url)
if not instance:
return None

request = requests.post(instance + '/api/v1/apps',
data={
'client_name': self._name,
Expand Down

0 comments on commit b03c070

Please sign in to comment.