https://reisub.nsupdate.info/git
/
relay.git
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a7390f5
)
actor: add LFUCache definition
author
kaniini
<kaniini@dereferenced.org>
Sun, 18 Nov 2018 14:15:34 +0000
(14:15 +0000)
committer
kaniini
<kaniini@dereferenced.org>
Sun, 18 Nov 2018 14:15:34 +0000
(14:15 +0000)
relay/actor.py
patch
|
blob
|
history
diff --git
a/relay/actor.py
b/relay/actor.py
index
b175dc9
..
f4473b5
100644
(file)
--- a/
relay/actor.py
+++ b/
relay/actor.py
@@
-11,6
+11,8
@@
from Crypto.PublicKey import RSA
from .database import DATABASE
from .http_debug import http_debug
+from cachetools import LFUCache
+
# generate actor keys if not present
if "actorKeys" not in DATABASE:
@@
-34,6
+36,10
@@
from .remote_actor import fetch_actor
AP_CONFIG = CONFIG.get('ap', {'host': 'localhost','blocked_instances':[]})
+CACHE_SIZE = CONFIG.get('cache-size', 16384)
+
+
+CACHE = LFUCache(CACHE_SIZE)
async def actor(request):