Find which scheduled event triggered a function in recurring schedule

Hi community.

Im bulding an app that synchronizes data from another api into freshservice.

The problem is that there is a lot of entries that needs to be imported and updated one time each day.

When running the scheduled event, i run into api rate limit after 160 api consumptions and need to create a queue system to handle the rest of the data. Here i though scheduled event could be used to handle the rest of the data in a recurring event by 1 minute. But the other event will just trigger the main eventhandler.

Is there a way to check which schedule that triggered the event if you have multiple schedules in an app?

@JonathanHojtoft ,
Good Day!

FYI:
you are able to create only one recurring schedule in the app,

Is there a way to check which schedule triggered the event if you have multiple schedules in an app?

there is no direct way to find which schedule is triggered the event, so
whenever the schedule is executed, you can maintain by storing the key-value pair in DB and use it

Hope it helps

2 Likes

Hi @JonathanHojtoft,

We have discussed your solution over our Office Hours call.

Here’s the gist of the solution discussed,

Scheduled events have a timeout of 20 seconds and APIs can be used within this execution time of the function. The state of the sync can be stored in the Data Storage of the platform.

If Scheduled events take more time to do complete sync, a standalone hosted server from your end is advised to use for sync the entries quickly without platform’s execution timeout limits.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.