~edwargix/git.sr.ht

103bafd9bd8903c95a2ea7469c39ffdd013ec90e — Drew DeVault 6 years ago b28e733
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.
1 files changed, 1 insertions(+), 3 deletions(-)

M gitsrht/git.py
M gitsrht/git.py => gitsrht/git.py +1 -3
@@ 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)