App works on localhost but not as installed app

Hi community.

I’m developing an app that synchronizes data from a thirdparty api and then imports the data into freshservice as assets. The data amount is around 2500 units that needs to be imported as assets.

This is setup to run once a day via scheduling to do these imports everyday.

To overcome the apirate limit, i’ve built a queue system that handles the requests that return 429 and tries again after 5 minutes.
The import runs smoothly when testing on localhost.
But when running the import cycle as an installed app. It fails after around 90-100 import [POST] request tries.

Has anyone encountered this issue before, that an app works on local but not as installed.

Do anyone have an idea if this is a memory issue on freshservice’s installed app system, or what can the issue be.

//Jonathan

1 Like

Hi @JonathanHojtoft,

We have discussed this problem over our Office hours meet.

The discussed points were,

  • The scheduled event handler function execution in the app gets timed out after the default 20 seconds.
  • The solution is to run the sync in batches so that each chunk of the data is synchronized completely within the 20 seconds timeout. Either repetitive one-time schedules or a recurring schedule can run this job.
  • As the scheduled job for batch sync would take more time to sync the whole units, an externally-hosted server can take up the sync job to complete it quickly. But, it would incur additional maintainenace cost to maintain the hosted server.
1 Like

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