Skip to content

Conversation

@tonial
Copy link
Contributor

@tonial tonial commented Oct 3, 2024

🤔 Pourquoi ?

On peut sans doute réduire la fréquence du cron, non ?

🍰 Comment ?

Décrivez en quelques mots la solution retenue et mise en oeuvre, les difficultés ou problèmes rencontrés. Attirez l'attention sur les décisions d'architecture ou de conception importantes.

🚨 À vérifier

  • Mettre à jour le CHANGELOG_breaking_changes.md ?

🏝️ Comment tester

Les instructions pour reproduire le problème, les profils de test, le parcours spécifique à utiliser, etc. Si vous disposez d'une recette jetable, mettre l'URL pour tester dans cette partie.

💻 Captures d'écran

@tonial tonial added the modifié Modifié dans le changelog. label Oct 3, 2024
@tonial tonial self-assigned this Oct 3, 2024
@notion-workspace
Copy link

@tonial tonial changed the title GPS: mise à jour automatique du conseiller FT GEN-2130 GPS: mise à jour automatique du conseiller FT Oct 3, 2024
@tonial tonial force-pushed the alaurent/gps branch 3 times, most recently from d04b285 to 751f527 Compare October 4, 2024 05:11
@tonial tonial requested a review from xavfernandez October 4, 2024 07:33
@tonial tonial force-pushed the alaurent/gps branch 3 times, most recently from 2761a34 to b048966 Compare October 8, 2024 10:01
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)
Copy link
Member

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 ?

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)
Copy link
Member

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.

@tonial
Copy link
Contributor Author

tonial commented Oct 10, 2024

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
Copy link
Contributor Author

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 ^^

@tonial tonial added this pull request to the merge queue Oct 10, 2024
Merged via the queue into master with commit 3085756 Oct 10, 2024
@tonial tonial deleted the alaurent/gps branch October 10, 2024 08:03
@notion-workspace
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modifié Modifié dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants