Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any timeout in Pocketquery when rendering the macro?

Cuto Calleja
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2016

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!

 

2 answers

1 accepted

1 vote
Answer accepted
Cuto Calleja
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2016

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!

 

Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2016

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

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.

Cuto Calleja
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2016

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

0 votes
Damien Braz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2016

Hi Cuto,

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

 

Best regards, Damien.

Cuto Calleja
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2016

Ah! Thanks! Not very "familiar" with this system!

 

wink

Damien Braz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2016

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events