Company
Date Published
Author
Brayden Girard
Word count
1781
Language
English
Hacker News points
None

Summary

Strapi, an open-source headless CMS based on Node.js, allows developers to manage content using RESTful APIs or GraphQL, and can be easily set up with simple commands. While Strapi's built-in Cron Jobs feature is effective for single-instance applications, it presents challenges when scaling horizontally, as it triggers tasks on all instances simultaneously, leading to potential issues like race conditions. To address this, the article outlines how to set up external Cron Jobs using Linux Crontab or GitHub Actions to avoid conflicts by triggering tasks through custom routes and controllers in Strapi. The process involves creating and configuring custom routes and controllers within Strapi, and then using external services to schedule and trigger these tasks, ensuring efficient operation even when the application is scaled across multiple servers.