Thursday, 15 March 2018

HOW TO RUN FILES THAT TAKES VERY LONG TIME TO RUN?

You might have encountered some situations when your file runs for very long time and it results in timeout in browser. This happens when browsers don’t get response within some stipulated time frame. Few examples of such situations are,

  1. generating report that needs lot many db operations,
  2. reading or writing many files(I/O Operations)
  3. long running data base operation through CF file etc.
  4.  A page request that has lot many back end jobs to complete. There could be many examples as such.

Here is the suggested solution for this type of situations.

  1. Set big requestTimeout value in the pages that are expected to run for very long time. Remember, here the value is in milliseconds.
  2. In place of directly calling the files in browser, create a scheduled task in CF Admin and there you set the file URL(see highlights in second screenshot). Mention timeout value to a bigger amount to ensure successful completion of the task.
  3. Here, to see what output you got from the page, you need to  check Publish checkbox(see highlights in second screenshot) and set a file path to write the output. Its recommended to set the output file extension to .html for better readability of output.
  4. Once you are done with all these setting and done with the scheduled task creation, run the scheduled task, by clicking on green icon, to run the file immediately(screenshot three).

Hope, these details will be of help. Any suggestion or question is most welcome.

No comments:

Post a Comment

Embedding Power BI Report Using ColdFusion

Recently I got an opportunity to embed power BI reports in ColdFusion Application. Please find the steps and requirements below for implem...