feat: backfiller le catalogue existant, une parole/heure

This commit is contained in:
2026-07-05 01:07:31 +04:00
parent 26471d8b0e
commit e416f94061
3 changed files with 129 additions and 0 deletions
+18
View File
@@ -1,6 +1,7 @@
const path = require('path');
const {backupDatabase} = require('../src/utils/backup-database');
const {importBokanteComments} = require('../src/utils/import-bokante-comments');
const {backfillBokanteMirror} = require('../src/utils/backfill-bokante-mirrors');
module.exports = {
myJob: {
@@ -37,4 +38,21 @@ module.exports = {
tz: 'Indian/Reunion',
},
},
backfillBokanteMirror: {
task: async ({ strapi }) => {
if (!process.env.BOKANTE_ACCESS_TOKEN) {
return;
}
const {backfilled, slug} = await backfillBokanteMirror({strapi});
if (backfilled) {
strapi.log.info(`Backfill bokante : parole "${slug}" publiée.`);
}
},
options: {
rule: process.env.BOKANTE_BACKFILL_CRON || '0 * * * *',
tz: 'Indian/Reunion',
},
},
};