{"id":1341,"date":"2016-10-05T00:00:00","date_gmt":"2016-10-05T00:00:00","guid":{"rendered":"http:\/\/www-staging.carta.com\/sg\/blog\/why-you-shouldnt-use-cron-jobs\/"},"modified":"2021-03-05T06:58:52","modified_gmt":"2021-03-05T06:58:52","slug":"why-you-shouldnt-use-cron-jobs","status":"publish","type":"post","link":"https:\/\/www-staging.carta.com\/sg\/blog\/why-you-shouldnt-use-cron-jobs\/","title":{"rendered":"Why you shouldn’t use “Cron Jobs?”"},"content":{"rendered":"\r\n
Executing a task on an interval or at a specific time is a common problem with application developers.<\/p>\r\n
Many software developers think, I know how to solve this, I’ll use cron.<\/p>\r\n
There is a better way.<\/p>\r\n
Developers of Web Applications are aware of a common problem of offloading a task that can hold up a web request by putting it into a background job. Python’s most famous background task worker is Celery. Celery has a built in feature called Beat, which is a scheduler.<\/p>\r\n
Here is how it works.<\/p>\r\n
Create a celery task. This is the same type of task you create when doing background work.<\/p>\r\n