diff --git a/app/comp/res_but.py b/app/comp/res_but.py index cc0b880799..aa9f3fe059 100644 --- a/app/comp/res_but.py +++ b/app/comp/res_but.py @@ -8,7 +8,7 @@ """ from app.comp import moy_ue, moy_sem, inscr_mod -from app.comp.res_sem import NotesTableCompat +from app.comp.res_common import NotesTableCompat class ResultatsSemestreBUT(NotesTableCompat): diff --git a/app/comp/res_classic.py b/app/comp/res_classic.py index 6cf092a818..93e3a9fb03 100644 --- a/app/comp/res_classic.py +++ b/app/comp/res_classic.py @@ -9,7 +9,7 @@ import numpy as np import pandas as pd from app.comp import moy_mod, moy_ue, moy_sem, inscr_mod -from app.comp.res_sem import NotesTableCompat +from app.comp.res_common import NotesTableCompat from app.models.formsemestre import FormSemestre diff --git a/app/comp/res_sem.py b/app/comp/res_common.py similarity index 100% rename from app/comp/res_sem.py rename to app/comp/res_common.py diff --git a/app/scodoc/sco_cache.py b/app/scodoc/sco_cache.py index 5bc9d3de81..fb43fbf3ce 100644 --- a/app/scodoc/sco_cache.py +++ b/app/scodoc/sco_cache.py @@ -155,16 +155,6 @@ class EvaluationCache(ScoDocCache): cls.delete_many(evaluation_ids) -class ResultatsSemestreCache(ScoDocCache): - """Cache pour les résultats ResultatsSemestre. - Clé: formsemestre_id - Valeur: { un paquet de dataframes } - """ - - prefix = "RSEM" - timeout = 60 * 60 # ttl 1 heure (en phase de mise au point) - - class AbsSemEtudCache(ScoDocCache): """Cache pour les comptes d'absences d'un étudiant dans un semestre. Ce cache étant indépendant des semestres, le compte peut être faux lorsqu'on @@ -224,7 +214,9 @@ class NotesTableCache(ScoDocCache): def get(cls, formsemestre_id, compute=True): """Returns NotesTable for this formsemestre Search in local cache (g.nt_cache) or global app cache (eg REDIS) - If not in cache and compute is True, build it and cache it. + If not in cache: + If compute is True, build it and cache it + Else return None """ # try local cache (same request) if not hasattr(g, "nt_cache"): @@ -322,3 +314,15 @@ class DefferedSemCacheManager: while g.sem_to_invalidate: formsemestre_id = g.sem_to_invalidate.pop() invalidate_formsemestre(formsemestre_id) + + +# ---- Nouvelles classes ScoDoc 9.2 +@classmethod +class ResultatsSemestreCache(ScoDocCache): + """Cache pour les résultats ResultatsSemestre. + Clé: formsemestre_id + Valeur: { un paquet de dataframes } + """ + + prefix = "RSEM" + timeout = 60 * 60 # ttl 1 heure (en phase de mise au point)