Create a Cron

Let’s now create a cron for the news application. This cron will ensure that the news items in the application are updated on a hourly basis by invoking the cron function automatically once every hour. The cron function will therefore make the API call to NewsAPI to obtain the latest news items once every hour.

To create a cron from the Catalyst console:

  1. Navigate to Cron under Develop and click Create Cron. cron_create_cron

  2. Enter a name and a description for the cron. You can enter any name. Select Function as the Schedule Point and select the NewsApp function. cron_node_create_cron

  3. Select Recursive as the Schedule Type and Every as the Repeat Type. Select 01 as the hour, 00 as the minute, and 00 as the second. Select the termination of the cron as Never. cron_recursive_setup

  4. Click Save. The cron will be created and listed in the Cron page along with its details. The function will now be invoked on an hourly basis. cron_view_cron

You can check the execution history of the cron after one hour by clicking the icon under History. cron_execution_history

The news application is now functional and will work without any errors.

Last Updated 2023-12-15 18:54:08 +0530 +0530


Cron Cron Function