Is there any timeout in Pocketquery when rendering the macro?

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

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!

 

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.

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

Hi Cuto,

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

 

Best regards, Damien.

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

 

wink

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

588 views 20 11
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you