Rafraichissement des factures par fin_connexion et fin_adhesion au plus une fois toutes les 1 min
This commit is contained in:
parent
4a0a514986
commit
c35878562a
1 changed files with 4 additions and 4 deletions
|
@ -66,7 +66,7 @@ import cranslib.deprecated
|
|||
|
||||
#: Champs à ignorer dans l'historique
|
||||
HIST_IGNORE_FIELDS = ["modifiersName", "entryCSN", "modifyTimestamp", "historique"]
|
||||
FACTURES_REFRESH_PERIOD = 5
|
||||
FACTURES_REFRESH_PERIOD = 60
|
||||
|
||||
def new_cransldapobject(conn, dn, mode='ro', uldif=None, lockId=None):
|
||||
"""Crée un objet :py:class:`CransLdapObject` en utilisant la classe correspondant à
|
||||
|
@ -1041,7 +1041,7 @@ class proprio(CransLdapObject):
|
|||
"""Retourne la date de fin d'adhésion"""
|
||||
return max([
|
||||
float(facture.get('finAdhesion', [crans_utils.from_generalized_time_format(attributs.finAdhesion.default)])[0])
|
||||
for facture in self.factures(refresh=True, mode="ro")
|
||||
for facture in self.factures(refresh=(time.time() - self._factures_last_update > FACTURES_REFRESH_PERIOD))
|
||||
if facture.get('controle', [''])[0] != u"FALSE" and facture.get('recuPaiement', [''])[0] != ''
|
||||
] + [0.0])
|
||||
|
||||
|
@ -1055,7 +1055,7 @@ class proprio(CransLdapObject):
|
|||
"""Retourne la date de fin de connexion"""
|
||||
return max([
|
||||
float(facture.get('finConnexion', [crans_utils.from_generalized_time_format(attributs.finConnexion.default)])[0])
|
||||
for facture in self.factures(refresh=True, mode="ro")
|
||||
for facture in self.factures(refresh=(time.time() - self._factures_last_update > FACTURES_REFRESH_PERIOD))
|
||||
if facture.get('controle', [''])[0] != u"FALSE" and facture.get('recuPaiement', [''])[0] != ''
|
||||
] + [0.0])
|
||||
|
||||
|
@ -1142,7 +1142,7 @@ class proprio(CransLdapObject):
|
|||
if self._factures:
|
||||
if self._factures[0].mode != mode:
|
||||
refresh = True
|
||||
if self._factures is None or (refresh and time.time() - self._factures_last_update > FACTURES_REFRESH_PERIOD):
|
||||
if self._factures is None or refresh:
|
||||
try:
|
||||
self._factures = self.conn.search(u'fid=*', dn=self.dn, scope=1, mode=mode)
|
||||
for m in self._factures:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue