Skip to content

Commit 6edcaaa

Browse files
committed
mirrors: cache get_mirror_errors
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.
1 parent 1101323 commit 6edcaaa

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

mirrors/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def get_mirror_statuses(cutoff=DEFAULT_CUTOFF, mirror_id=None, show_all=False):
154154
}
155155

156156

157+
@cache_function(127)
157158
def get_mirror_errors(cutoff=DEFAULT_CUTOFF, mirror_id=None, show_all=False):
158159
cutoff_time = now() - cutoff
159160
errors = MirrorLog.objects.filter(

0 commit comments

Comments
 (0)