ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Help with Cron and API


#1

Hi,

I am creating an API for fetching data from one database to hash. I am creating API for doing so. But there’s a confusion which might be good approach for so. Since the database from where I am fetching data gets updated every 1 hour, I want to schedule it (via cron).

Will it be a better idea that if I handle my file(api file) with cron or there’s some way I can use hooks.py to handle the scheduling. Its just a random guess. Any help/suggestions will be appreciated :thinking:


#2

Hi,
I think it should help you https://frappe.io/docs/user/en/tutorial/task-runner
also I think that hourly type is most suitable for you)