gatsbyjs / gatsby-source-wordpress-experimental

The upcoming v4 of gatsby-source-wordpress, currently in beta
MIT License
385 stars 100 forks source link

Feature request: add timeout option for image requests #356

Closed dipankarmaikap closed 3 years ago

dipankarmaikap commented 3 years ago

When fetching media items/images it returns. Fetching image_url is taking a long time time (longer than 15 seconds). This file is File_size MB After few of this line it crashes with error RequestError: Timeout awaiting 'request' for 30000ms.

Here is my config

    {
      resolve: `gatsby-source-wordpress-experimental`,
      options: {
        url: `https://siteurl/graphql`,
        verbose: true,
        html: {
          imageMaxWidth: 700,
          imageQuality: 80,
        },
        schema: {
          timeout: 120000,
          requestConcurrency: 50,
          perPage: 50,
        },
        type: {
          __all: {
            limit: 500,
          },
        },
      },
    },

I don't understand why it would say error RequestError: Timeout awaiting 'request' for 30000ms. as you can see the time out is set to 2min. Also how can I can increase the media fetching time more than 15sec. Please let me know what am I doing wrong or how can I resolve this issue.

Thank You

TylerBarnes commented 3 years ago

Hi @dipankarmaikap , the timeout setting you're mentioning is for GraphQL requests. There isn't currently a setting for the timeout of individual images. A new option would need to be added for this.

TylerBarnes commented 3 years ago

I've moved this to our internal backlog - if anyone feels strongly about this feature please add a feature request at https://portal.gatsbyjs.com/gatsby-cloud