From 861e75fde277e2287dff82441f9b1932bd2e99c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sat, 4 Jul 2026 23:39:25 +0400 Subject: [PATCH] feat: planifier l'import des commentaires bokante (20 min) --- config/cron-task.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/config/cron-task.js b/config/cron-task.js index fc910a8..d6bd687 100644 --- a/config/cron-task.js +++ b/config/cron-task.js @@ -1,5 +1,6 @@ const path = require('path'); const {backupDatabase} = require('../src/utils/backup-database'); +const {importBokanteComments} = require('../src/utils/import-bokante-comments'); module.exports = { myJob: { @@ -19,4 +20,21 @@ module.exports = { tz: 'Indian/Reunion', }, }, + importBokanteComments: { + task: async ({ strapi }) => { + if (!process.env.BOKANTE_ACCESS_TOKEN) { + return; + } + + const {imported} = await importBokanteComments({strapi}); + + if (imported > 0) { + strapi.log.info(`Import bokante : ${imported} commentaire(s) importé(s).`); + } + }, + options: { + rule: '*/20 * * * *', + tz: 'Indian/Reunion', + }, + }, };