Skip to content

Commit

Permalink
mirrors: cache get_mirror_errors
Browse files Browse the repository at this point in the history
This function is quite slow on my desktop and also on our live env.
Cache it until we have found a way to optimise the SQL query.
  • Loading branch information
jelly committed Jul 22, 2024
1 parent 1101323 commit 6edcaaa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mirrors/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def get_mirror_statuses(cutoff=DEFAULT_CUTOFF, mirror_id=None, show_all=False):
}


@cache_function(127)
def get_mirror_errors(cutoff=DEFAULT_CUTOFF, mirror_id=None, show_all=False):
cutoff_time = now() - cutoff
errors = MirrorLog.objects.filter(
Expand Down

0 comments on commit 6edcaaa

Please sign in to comment.