Extending timeout - docker
-
Off-topic note: I had to create a second account on this forum because for some reason, the traditional login is not showing. It is showing only "Alternative logins".
Topic: Is there a way to increase the timeout of pdf generation for jspreort deployed as docker image? (Azure web app)
https://jsreport.net/blog/long-reports
I see no env variable for it in your blog.
-
I am getting sometimes the following error, it doesn't happen always, note that there's a one image as link (img tag) in the html which may be the culprit (that img has to be dynamic because it's related to branding):
Error: Error while executing pdf-utils operations. Timeout Error: pdf generation not completed after 30000ms
at module.exports (F:\Downloads\AllFineonProjects\jsreport-azure-functions-starter-fineon\node_modules\jsreport-core\lib\util\createError.js:11:13)
at Reporter.createError (F:\Downloads\AllFineonProjects\jsreport-azure-functions-starter-fineon\node_modules\jsreport-core\lib\reporter.js:332:12)
at AsyncFunction.<anonymous> (F:\Downloads\AllFineonProjects\jsreport-azure-functions-starter-fineon\node_modules\jsreport-pdf-utils\lib\main.js:382:22)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
caused by: Error: Timeout Error: pdf generation not completed after 30000ms
at process.<anonymous> (F:\Downloads\AllFineonProjects\jsreport-azure-functions-starter-fineon\node_modules\script-manager\lib\worker-processes.js:55:23)
at process.emit (events.js:310:20)
at emit (internal/child_process.js:876:12)
at processTicksAndRejections (internal/process/task_queues.js:85:21)
-
You can use
reportTimeout
config, set the number of ms there, and pass it to the azure web app as an environment variable.
This can be done in the azure portal / web app / application settings.
https://jsreport.net/blog/render-reports-using-azure-app-service
-
another solution was to pass the image as base64 instead of url, it made it faster.
-
@jan_blaha So generally any property in config can be passed as env variable?
-
Yes, check these docs - https://jsreport.net/learn/configuration#configuration-sources
jsreport merges configuration from config file, environment variables, command line arguments and also directly from the application code in this exact order.