API Timeout | JsReportOnline



  • I am currently using the API for JsReport Online.
    There is a 20s timeout for chrome-pdf and a 10s timeout for html-to-xlsx.
    I'm using the free version right now for development but when this goes into production we were thinking we would AT LEAST need the silver $100 per month subscription. If we move off of the free version will that help with the timeout times?

    It's a school software so in the example of a school printing something that involves all the students the 20s timeout is not enough. Plus multiple users could be queering at the same time.


  • administrators

    hi! right now changing the plan does not have any effect in the chrome, templating engines compilation timeout.. the better plan gives you better render throttling (it let you process more renders) and allows you to store mote entities.

    however this is not the first time that timeouts is asked to be configurable, the problem is a bit tricky because right now those kind of configuration is global in the whole jsreport server which is something that won't work in the jsreportonline case because a configuration like that should be per user/tenant in the service.

    we opened an issue recently with some thoughts about how to make this work, you can check it here and subscribe to get notifications about progress. we don't have any timeline when that will be done, but it should be soon after we release the next version of jsreport (which we are currently preparing)



  • I talked to my boss about this. The 1000s throttle could also be an issue. If we had 300 users submit a request for a report within 5 minutes it would be an issue. Is the 1000s throttle something that could be changed? We might be able to live with the timeout issue.

    Another question is since I am using the API is there a way to know how many credits a report is using? I'd like to have that value returned somehow so I can store it.



  • Is the 1000s throttle something that could be changed?

    This is something we could change for specific customers, however, this would be done in a rare case. Perhaps you could just implement a retry mechanism on your client end and it would be enough.

    Another question is since I am using the API is there a way to know how many credits a report is using? I'd like to have that value returned somehow so I can store it.

    The response contains header JO-Credits-Spent


    You can start with jsreportonline and we try together to cover your use case. And if it turns out you need a better scalable solution. You can spin it in your own servers with jsreport on premise. The migration is typically just about some clicks and exporting templates from jsreportonline and importing into yours.



  • Do you have an example of getting that? I keep getting "undefined" when I try a few different ways to access the response header.

    My code looks like this..

    jsreport.renderAsync(request).then(function(res) {
        console.log( "in async...." );
        var html = '<html>' +
            '<style>html,body {padding:0;margin:0;} iframe {width:100%;height:100%;border:0}</style>' +
            '<body>' +
            '<iframe type="application/pdf" src="' +  res.toDataURI() + '"></iframe>' +
            '</body></html>';
        var a = window.open("about:blank", "Report")
    
        a.document.write(html)
        a.document.close();


  • I can't find any way to get the header "JO-Credits-Spent".



  • Unfortunately, you can't get response headers using browser client at this moment.

    However, in the real production, you would anyway use another method to make rest request and you can easily get the headers there.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.