feat: planifier l'import des commentaires bokante (20 min)
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const {backupDatabase} = require('../src/utils/backup-database');
|
const {backupDatabase} = require('../src/utils/backup-database');
|
||||||
|
const {importBokanteComments} = require('../src/utils/import-bokante-comments');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
myJob: {
|
myJob: {
|
||||||
@@ -19,4 +20,21 @@ module.exports = {
|
|||||||
tz: 'Indian/Reunion',
|
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',
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user