I have a GP tool that creates a PDF report from a map click. I'm testing running multiple reports simultaneously from different browsers. If I run two reports, one will return a PDF to the popup, and the other displays the PDF for a brief instant and then displays "Unable to generate report." If I click on the GP tool again, the report will popup, because I have set the script to check to see if a report has already been generated for that location. In the console log, I see "Timeout Exceeded." This happens after about a minute, even thought the report has obviously been generated. Do I need to set a higher timeout limit?
Here is my code snippet. The clearInteval function is for animated dots while the report is being generated, not related to the timeout.
<SPAN class="keyword token">function</SPAN> <SPAN class="token function">gpreportResultAvailable</SPAN><SPAN class="punctuation token">(</SPAN>results<SPAN class="punctuation token">,</SPAN> messages<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>
domAttr<SPAN class="punctuation token">.</SPAN><SPAN class="keyword token">set</SPAN><SPAN class="punctuation token">(</SPAN>dom<SPAN class="punctuation token">.</SPAN><SPAN class="token function">byId</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"reportLink"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">"innerHTML"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Forecast Report"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
window<SPAN class="punctuation token">.</SPAN>map<SPAN class="punctuation token">.</SPAN>infoWindow<SPAN class="punctuation token">.</SPAN><SPAN class="token function">clearFeatures</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> contentResult<SPAN class="punctuation token">;</SPAN>
results <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN><SPAN class="punctuation token">(</SPAN>results<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>
contentResult <SPAN class="operator token">=</SPAN><SPAN class="string token">'<a target="_blank" href="'</SPAN> <SPAN class="operator token">+</SPAN> reportPath <SPAN class="operator token">+</SPAN> <SPAN class="string token">'"><IMG SRC="'</SPAN> <SPAN class="operator token">+</SPAN> pdfIcon <SPAN class="operator token">+</SPAN> <SPAN class="string token">'"width=25% height=25%/></a>'</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">{</SPAN>
contentResult <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Unable To Generate Report"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="token function">clearInterval</SPAN><SPAN class="punctuation token">(</SPAN>dots<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
window<SPAN class="punctuation token">.</SPAN>map<SPAN class="punctuation token">.</SPAN>infoWindow<SPAN class="punctuation token">.</SPAN><SPAN class="token function">resize</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">256</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">256</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
window<SPAN class="punctuation token">.</SPAN>map<SPAN class="punctuation token">.</SPAN>infoWindow<SPAN class="punctuation token">.</SPAN><SPAN class="token function">setContent</SPAN><SPAN class="punctuation token">(</SPAN>contentResult<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
window<SPAN class="punctuation token">.</SPAN>map<SPAN class="punctuation token">.</SPAN>infoWindow<SPAN class="punctuation token">.</SPAN><SPAN class="token function">setTitle</SPAN><SPAN class="punctuation token">(</SPAN>displayCountry <SPAN class="operator token">+</SPAN> <SPAN class="string token">" Forecast Analysis Report"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>