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:
Navigate to Cron under Develop and click Create Cron.
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.
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.
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.
You can check the execution history of the cron after one hour by clicking the icon under History.
The news application is now functional and will work without any errors.
Last Updated 2023-12-15 18:54:08 +0530 +0530