Closed alexolivier closed 3 weeks ago
I've been trying to setup a native cronjob to call this for indexing, and landed on the following which doesn't feel right. Do you have a recommended approach?
module.exports = { algolia: { task: async ({ strapi }) => { try { const indexer = strapi.plugins["strapi-algolia"].controllers[ "strapi-algolia-index-articles" ].index; await indexer({ request: { body: { name: "api::article.article" } }, send: console.log, }); } catch (e) { console.error(e); } }, options: { rule: "0 * * * *", }, }, };
Mmm, for me it's a good solution, we didn't put the index-all method into a service, so it's the good way to call it.
index-all
I've been trying to setup a native cronjob to call this for indexing, and landed on the following which doesn't feel right. Do you have a recommended approach?