module.exports = { checkPublish: { task: async ({ strapi }) => { const now = new Date(); const entries = await strapi.documents('api::test-txt.test-txt').findMany({ filters: { publish_at: { $lte: now }, publishedAt: null }, status: 'draft', }); for (const entry of entries) { await strapi.documents('api::test-txt.test-txt').publish({ documentId: entry.documentId, }); } }, options: { rule: '* * * * *', // Runs every minute }, }, };