Is there any timeout in Pocketquery when rendering the macro?
Asked by Cuto Calleja:

When trying to update several pocketquery macros in a confluence page using javascript (a button) it happens that some of then are not finally rendered. I've checked that is not a problem of the installation or related to the google chart graphics... on the contrary I think is related to the execution time of the query. In general all queries executed in less than 10s have not problems in rendering properly when updating with the javascript button... but those queries taking, in general, more than 10s are usually not finnaly displayed remaining the "ongoing" icon in the screen...

The code of my template is as follows:

*\<form id="my-pocketquery-form" class="aui"\>*

*\<button type="button" onclick = "reloda()" \>UPDATE\</button\>*

*\</form\>*

*\<script\>*

***-- solution***

***jQuery.ajaxSetup({timeout: 60000});***

*function reloda()*

*{*

*jQuery('.pocketquery-dynamic-load').each(function() {*

*var container = jQuery(this);*

*var dataIndex = container.data('index');*

*data = PocketQuery.getDynamicLoadData(dataIndex);*

*PocketQuery.load({*

*container: container,*

*data: data*

*});*

*});*

*}*

*\</script\>*

Is there somewhere a "timeout" parametter I could modify to make it work properly or is there any other code for my template solving this issue?

Thanks in advance!


Answers:
author: Cuto Calleja
body: I think I've found the solution myself!

Now it is working writing ***"jQuery.ajaxSetup({timeout: 60000});***" at the begining of the script...

Hope it helps someone else!

comments: author: Felix Grund (Scandio)
body: Hi Cuto! Just wanted to let you: your solution will change the Ajax setup for any request on your page, not only the ones from PocketQuery. You should add the url flag to the object you're giving to ajaxSetup as described in the [jQuery docs](https://api.jquery.com/jquery.ajaxsetup/).

I put a new timeout parameter flag for the PocketQuery.load method on our roadmap!

By the way: would you be willing to install our release candidate for PocketQuery 2.1? This release has the PocketQuery Admin split from the Confluence Admin and it could be useful for you :smile:. You can find it [here](https://cloud.scandio.de/index.php/s/QClcNkXBm5Gkb8i).


author: Cuto Calleja
body: Hi Felix! Thanks again!

I will take a look! What will be good maybe is to have the possibility to define the ajaxSetup timeout as a Pocketquery parametter then...

I knew already about your 2.1 version and I was waiting for it... if the PocketQuery Admin has been splitted from the Confluence Admin 50% of my "pending requests" is already covered... and it would ony rest the possibility to print out!!! :wink:

Regards


author: Damien Braz
body: Hi Cuto,

Your should "accept" your answer to help people see this request have a resolution :smile:

Best regards, Damien.

comments: author: Cuto Calleja
body: Ah! Thanks! Not very "familiar" with this system!

:wink:


author: Damien Braz
body: No problem :smile:

A bit of people accept answer :smile:

But, in my opinion it's a bad choice, cause we can't know when they need more help or not.

For people who need for an answer, they can't know if a solution worked or not :smile: