maybe if i cache mastodon api instances i can avoid 50% of calls?
im just throwing shit at the wall here im running out of ideas this could also fuck everything up idk let's see uhh issue #10
This commit is contained in:
parent
a649d21549
commit
7967cc686c
|
@ -7,6 +7,7 @@ from app import db, sentry
|
|||
from math import inf
|
||||
import iso8601
|
||||
from libforget.exceptions import TemporaryError
|
||||
from functools import lru_cache
|
||||
|
||||
|
||||
def get_or_create_app(instance_url, callback, website):
|
||||
|
@ -68,6 +69,7 @@ def receive_code(code, app, callback):
|
|||
return token
|
||||
|
||||
|
||||
@lru_cache()
|
||||
def get_api_for_acc(account):
|
||||
app = MastodonApp.query.get(account.mastodon_instance)
|
||||
for token in account.tokens:
|
||||
|
|
|
@ -92,7 +92,7 @@ def test_brotli_dynamic_cache(br_client):
|
|||
def test_brotli_dynamic_timeout(app):
|
||||
from secrets import token_urlsafe
|
||||
|
||||
libforget.brotli.brotli(app, timeout=0.01)
|
||||
libforget.brotli.brotli(app, timeout=0)
|
||||
|
||||
@app.route('/hard_to_compress')
|
||||
def hard_to_compress():
|
||||
|
|
Loading…
Reference in New Issue