summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-10-06 18:29:47 -0400
committerDrew DeVault <sir@cmpwn.com>2018-10-06 18:29:47 -0400
commit103bafd9bd8903c95a2ea7469c39ffdd013ec90e (patch)
tree0ef6140e746933cd9fc138063d9d245dc8bc6572
parentb28e7333c7cd312be4395caa11c462a44dfbec5f (diff)
Remove lru_cache from git.py
I wonder if this is causing our OOM issues... and if it's not, I want to know if it's actually necessary.
-rw-r--r--gitsrht/git.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/gitsrht/git.py b/gitsrht/git.py
index 257e954..a3f0e92 100644
--- a/gitsrht/git.py
+++ b/gitsrht/git.py
@@ -1,6 +1,5 @@
from collections import deque
from datetime import datetime, timedelta, timezone
-from functools import lru_cache
from gitsrht.redis import redis
from pygit2 import Repository, Tag
from jinja2 import Markup, escape
@@ -21,11 +20,10 @@ def commit_time(commit):
diff = datetime.now(timezone.utc) - tzaware
return datetime.utcnow() - diff
-@lru_cache(maxsize=256)
+# TODO: this is no longer cached so we should probably get rid of it
def CachedRepository(path):
return _CachedRepository(path)
-@lru_cache(maxsize=1024)
def _get_ref(repo, ref):
return repo._get(ref)