AnsweredAssumed Answered

What is the syntax for the printtask.execute errback?

Question asked by a_farnsy on Jun 22, 2016
Latest reply on Jun 29, 2016 by a_farnsy

I'm writing an angular application that uses the esri map control and a lot of other functionality. I have a printtask that allows a user to print a map with any layers they may have added. I've also allowed them to select pages sizes from A4, A3, A1, A0. When I first started working with this, A1 would timeout. I then set my print service to be Async, and provided the async: true param to the PrintTask constructor. However I find that if the map has a large number of layers and the user selects A0, the service is still timing out with the following error:

 

{"type":"esriJobMessageTypeInformative","description":"Processing request took longer than the usage timeout for service 'Utilities/PrintingTools.GPServer'."}

 

I've provided the errback parameter to the call to execute for the printtask, however it isn't invoked. I set a param in the app to indicate a print job is currently underway, however because the error callback isn't called, I'm unable to set this flag.

 

How do I go about implementing the error callback? I've searched the web and can't find an example that implements this callback. I see in the network tab of the chrome dev tools that the arcgis api is polling the server every second for (i guess) about 5 minutes, and the final message is the failure message.

 

Below is my current code:

 

                            printTask.execute(printParameters,

                                function (result) {

                                    $log.debug('Esri portion of print task complete...');

//work with print task output

                                },

                                function(errorResult) {

                                    $log.Info(errorResult);

                                });

 

Also, where do I configure the "usage timeout" for the print tools service?

 

Prints larger than A3 can take 3 or 4 minutes - this is on a server with a reasonable spec - is this expected? Is there anything I can do to improve print performance times?

Outcomes