algolia / gatsby-plugin-algolia

A plugin to push to Algolia based on graphQl queries
https://yarn.pm/gatsby-plugin-algolia
Apache License 2.0
177 stars 45 forks source link

Timeout Issues #117

Closed DanielRiveraHQ closed 3 years ago

DanielRiveraHQ commented 3 years ago

Hey guys, just wondering if there is any way I can set something to increase the time to declare timeout.

I have a big website with lots of index and my production build is failing

Thank you for your help

DanielRiveraHQ commented 3 years ago

Adding a screenshot of the log I'm getting:

Screen Shot 2021-02-21 at 3 44 05 PM

Do you think it can be customized in the plugin the timeout accessing this?: https://www.algolia.com/doc/api-reference/api-methods/configuring-timeouts/

eunjae-lee commented 3 years ago

@Haroenv I think the error is thrown from around here. Do you see any solution or workaround? Only a way in my mind is to patch-package the timeout values within algoliasearch.

Haroenv commented 3 years ago

Could you change

https://github.com/algolia/gatsby-plugin-algolia/blob/2f4c093e90e128e351fd77b2a8195811cf0f6026/gatsby-node.js#L46

to:

 const client = algoliasearch(appId, apiKey, { timeout: 30_000 }); 

and see if this makes a difference? Does this consistently happen for you @DanielRiveraHQ

DanielRiveraHQ commented 3 years ago

@Haroenv @eunjae-lee This worked great! I had to implement another fix about the new method to use GraphQL in Gatsby.

Here is the forked repo I created in case you want to take a look: https://github.com/Revere-Health/gatsby-plugin-algolia

Thank you for your help

Haroenv commented 3 years ago

this has been fixed in https://github.com/algolia/gatsby-plugin-algolia/commit/7641b45b8123aaca423b2c588b7d200dfeb0c3da and published in 0.16.5!