feat: backfiller le catalogue existant, une parole/heure
This commit is contained in:
@@ -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',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user