你已执行此操作过多次错误

I get the below error quite a few times.

{"errors":["You’ve performed this action too many times. Please wait a few seconds before trying again."],"error_type":"rate_limit","extras":{"wait_seconds":0}}

How do I eliminate this error. Please suggest.

1 个赞

Go look in settings > Rate Limit. Change the values as you please

Hi @IAmGav,

I have made,

  1. rate limit create topic = 0 (After creating a topic, users must wait (n) seconds before creating another topic.)
  2. rate limit create post = 0 (After posting, users must wait (n) seconds before creating another post.)
  3. rate limit new user create topic = 0 (After creating a topic, new users must wait (n) seconds before creating another topic.)
  4. rate limit new user create post = 0 (After posting, new users must wait (n) seconds before creating another post.)

But, still the error is persistent. Are there any other limits I need to look at.

1 个赞

I have disabled all the settings mentioned in:

But, still I get the “You Have Performed this Action Too Many Times” error.
Is there something else I have to do?

So what are you exactly doing what causes this error?

I am trying to create Topics using API. While trying to create like 100 topics through API, it is throwing me this error.
I am also trying to Update Tags to my Topics through API, there are 100s of Topics in my forum which do not have tags. So I am updating tags to them through API.

So what are the values of

DISCOURSE_MAX_USER_API_REQS_PER_MINUTE
DISCOURSE_MAX_USER_API_REQS_PER_DAY
DISCOURSE_MAX_ADMIN_API_REQS_PER_KEY_PER_MINUTE

and are you sure you’re staying below those numbers?

2 个赞

你好 :wave:
我遇到了同样的问题,但这是关于读取操作的。

我正在构建一个与 Discourse 的集成,并使用 API 读取大量帖子。我没有进行任何写入操作,只是读取。为了获取最新的帖子,我执行以下操作:

  1. 使用 /latest.json 端点获取最新的主题。
  2. 按顺序获取所有主题,通过 /t/:id,这样我就可以获得帖子的流并进行分页。
  3. 如果主题中有超过 20 个帖子,则从“stream”中获取它们的 ID,并以 20 个为一组的块顺序获取它们。

我还会在队列中执行所有请求,并尝试在 10 秒内发送不超过约 25 个请求,但仍然经常看到主题或帖子读取请求出现“您执行此操作的次数过多”错误。我查看了 Discourse 设置,但找不到任何读取限制。我只能看到“创建主题”和其他写入操作的限制。

我能对此做些什么吗?感谢您的任何建议,并为再次提起这个旧话题道歉。

1 个赞

看起来我达到了 max_admin_api_reqs_per_minute 的限制。可以自定义吗?在“设置”>“速率限制”中看不到。

编辑:实际上,似乎有两个限制生效。admin_api_key_rate_limitip_10_secs_limit

1 个赞

我想知道添加 ?print=true 是否有助于减少读取时的 API 调用次数?

这将允许您在一次 API 调用中获取 1000 篇帖子。

哦,出于某些原因,我以为 ?print 的速率限制更严格\n\n

\n\n但似乎这与 ?print=true 的使用无关,而是其他原因。我一定会试试。\n\n但据我所知,这只对超过 20 个帖子的主题有帮助。我相信我们的大多数主题帖子都少于这个数量,所以真正的瓶颈是过多的主题请求。

1 个赞

是的,那是用于限制用户。如果你有管理员 api 密钥,该设置不会影响你。

啊,是的,很有可能。

除了检查 429 错误并根据指定数量减慢速度之外,还有一些其他选项。

我建议先使用数据浏览器插件编写一个查询,以获取你想要的所有主题。我相信它最多可以返回 1000 个结果。然后,你可以使用 api 调用该查询并获取响应。

根据你的用例,webhooks 也可能很有帮助。你可以为每个新主题和帖子设置它们,然后只收听所有最新内容。

如果你仍然认为需要提高 api 速率限制,我们可以做到,但这仅限于我们的企业版套餐,因为它们不在我们的共享 pro/business 托管上。

使用数据探索器插件的问题在于,我们并不是 Discourse 集成的唯一用户。我们(fibery.io)允许我们的客户集成他们的 discourse 实例,以便他们能够无缝地将数据同步到我们的工具。

Webhooks 是一个不错的补充,但它们在首次同步(这是最繁重的工作,例如上个月的主题和帖子)时没有帮助。之后,我们会为新数据安排同步,这不成问题。

检查 429 并重试可以正常工作,只是有时会很慢)

感谢您的关注 :bow:

1 个赞