-
Notifications
You must be signed in to change notification settings - Fork 26
GPS: mise à jour automatique du conseiller FT #4869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d04b285 to
751f527
Compare
2761a34 to
b048966
Compare
| logger.warning( | ||
| f"There are {count_nir_invalid_length} included NIR values of invalid length after treatment." | ||
| ) | ||
| nir_to_contact = parse_gps_advisors_file(import_excel_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi ne pas réutiliser la clé de cache si elle existe ?
itou/gps/utils.py
Outdated
| if count_nir_invalid_length: | ||
| logger.warning(f"There are {count_nir_invalid_length} included NIR values of invalid length after treatment.") | ||
|
|
||
| cache.set(GPS_ADVISORS_KEY, nir_to_contact) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On pourrait éventuellement lui donner un timeout, genre 24h, pour qu’un nouveau fichier soit pris en compte à cette fréquence (sachant que les nouveaux fichiers arrivent très rarement pour le moment, on en a eu 1 depuis août...). Et comme ça, pas besoin de parser régulièrement le fichier Excel.
|
A vrai dire, j'envisageais de passer le cron à une fois par jour, en mettant à jour le cache, mais sans mettre d'expiration à celui-ci pour éviter qu'un décalage du cron, ou un fail ne fasse qu'on saute les utilisateurs pendant un jour entier. |
| if count_nir_invalid_length: | ||
| logger.warning(f"There are {count_nir_invalid_length} included NIR values of invalid length after treatment.") | ||
|
|
||
| cache.set(GPS_ADVISORS_KEY, nir_to_contact, timeout=60 * 60 * 24 * 14) # two weeks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@francoisfreitag en vrai, je crois que le timeout par défaut c'est 5 minutes, donc heureusement qu'on en met un autre ^^
🤔 Pourquoi ?
On peut sans doute réduire la fréquence du cron, non ?
🍰 Comment ?
🚨 À vérifier
🏝️ Comment tester
💻 Captures d'écran