reactjs - graphql 无法将 100 多种产品添加到我的 Wordpress Woocomerce 商店
问题描述
任何人都知道如何解决这个graphql错误?我不能向我的商店添加超过 50 件商品。
我在选项架构中提出了超时options: {schema: { timeout: 1000000,},}
并将这一行添加到 wp.config 文件中define( ‘WP_MEMORY_LIMIT’, ‘512M’ );
,但它没有解决问题。我的最大值是 46 项,但我想这不是限制。
info gatsby-source-wordpress GraphQL vars: {"first":70,"url":"http://my-web-url/graphql","after":null}
error gatsby-source-wordpress Your wordpress server at http://my-web-url/graphql appears to be overloaded.
Try reducing the requestConcurrency for content updates or the previewRequestConcurrency for previews:
{
resolve: 'gatsby-source-wordpress-experimental',
options: {
schema: {
requestConcurrency: 5, // currently set to undefined
previewRequestConcurrency: 2, // currently set to undefined
}
},
}
The GATSBY_CONCURRENT_REQUEST environment variable is no longer used to control concurrency.
If you were previously using that, you'll need to use the settings above instead.
not finished source and transform nodes - 5.466s
not finished gatsby-source-wordpress fetching nodes - 5.390s - 15 total
not finished gatsby-source-wordpress PaColor - 3.871s
not finished Downloading remote files - 3.569s
not finished Generating image thumbnails - 3.428s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: /node14/bin/node
Arguments: /vercel/.yarn/lib/cli.js build
Directory: /vercel/path0/site
Output:
info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-woocommerce-themes@2.0.1 build: `yarn workspace site build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gatsby-woocommerce-themes@2.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /vercel/.npm/_logs/2021-09-21T17_39_01_248Z-debug.log
Error: Command "npm run build" exited with 1
解决方案
嗯,这很简单。您已经达到了超时/过载响应,这不仅是因为页面数量,还因为它的内容和重量。使用提供的解决方案:
{
resolve: 'gatsby-source-wordpress',
options: {
schema: {
requestConcurrency: 50,
previewRequestConcurrency: 50,
}
},
}
并按照文档的建议使用requestConcurrency
和previewRequestConcurrency
价值观。使用之前的值 (50) 应该可以工作,因为现在设置为undefined
这样,您应该会看到一些改进。
GATSBY_CONCURRENT_REQUEST
请注意以下语句,如果您使用环境变量,这也很重要:
GATSBY_CONCURRENT_REQUEST
环境变量不再用于控制并发。如果您以前使用过它,则需要改用上面的设置。
推荐阅读
- c# - 我的列表
原点值更改时不更新 - deployment - 构建和部署时态工作流的最佳实践
- spring - 如何使用 Spring Batch 读取多个表
- alpine.js - Alpine JS:双向绑定转换的输入值?
- c# - 即使包含不记名令牌(由 IdentityServer4 生成),授权属性也会返回 401
- excel - 如何检测用户是否单击文件>>打印作为选项或使用 VBA 代码从 MS Word 或 Excel 中按 CTRL+P?
- spring-cloud-dataflow - scdf是如何实现多输出功能的?
- html - 为什么文件上传成功后我的网站没有更新?(FTP)
- flutter - 对如何解决 fl graphs 和 provider 感到困惑
- reactjs - 无法将外部 babel 插件添加到 react-app-rewired