# 图标弃用警告导致速率限制问题

**URL:** https://meta.discourse.org/t/icon-deprecation-warnings-causing-rate-limiting-issues/145586
**Category:** Support
**Created:** [2020年三月25日 19:46 UTC](https://meta.discourse.org/t/icon-deprecation-warnings-causing-rate-limiting-issues/145586 "2020-03-25T19:46:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2020年三月25日 19:46 UTC](https://meta.discourse.org/t/icon-deprecation-warnings-causing-rate-limiting-issues/145586/1 "2020-03-25T19:46:17Z")

</div>

最近我们越来越多地遇到这种情况：

主题和插件引发了大量“FA 图标弃用”警告：

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/3/b39bd281d841eeebe3d3baa0f4034dd7b875317d.png)

对此，我见过两种不同的回应：“别担心，这只是一个警告”和“如果你想消除这些警告，只需修复主题或插件即可”（但这并不总是容易做到）。

所以，我们不妨忽略这些警告。或者……事实证明……这些警告经常导致 429 速率限制错误，我们的日志中充满了：

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/1/81397d1117787169aed8dce4b050b314a8d8c1a1.png)

是否有可能在客户端对这些警告进行速率限制，以避免触发大量请求？或者将 `POST /logs/` 从速率限制中豁免？

@outofthebox @WorldIsMine 请留意。

---

<div class="post-metadata">

### Author: ![outofthebox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/outofthebox/32/83708_2.png) [@outofthebox](https://meta.discourse.org/u/outofthebox)
#### Post date: [2020年三月25日 20:01 UTC](https://meta.discourse.org/t/icon-deprecation-warnings-causing-rate-limiting-issues/145586/2 "2020-03-25T20:01:20Z")

</div>

谢谢 @RGJ！我认为这将提升性能。

---

<div class="post-metadata">

### Author: ![WorldIsMine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/worldismine/32/455660_2.png) [@WorldIsMine](https://meta.discourse.org/u/WorldIsMine)
#### Post date: [2020年三月25日 20:15 UTC](https://meta.discourse.org/t/icon-deprecation-warnings-causing-rate-limiting-issues/145586/3 "2020-03-25T20:15:16Z")

</div>

我可以确认，我的网站也出现了这个问题。如果我们打开太多内容太快，就会收到这个错误：

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/c/ccb232166c62d180fa330d29009695f436e62112.png)

现在甚至过快点赞也可能导致 429 错误。这一切都只是因为两个已过时的小图标。

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2020年三月26日 02:44 UTC](https://meta.discourse.org/t/icon-deprecation-warnings-causing-rate-limiting-issues/145586/4 "2020-03-26T02:44:17Z")

</div>

我以为@pmusaraj 已经处理过这个问题了？不太确定。

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2020年三月26日 03:00 UTC](https://meta.discourse.org/t/icon-deprecation-warnings-causing-rate-limiting-issues/145586/5 "2020-03-26T03:00:08Z")

</div>

图标弃用警告已实施速率限制，这要归功于 @david 提交的 [https://github.com/discourse/discourse/commit/7737ecd0fed808a1c0e429565058c817af99d707。](https://github.com/discourse/discourse/commit/7737ecd0fed808a1c0e429565058c817af99d707%E3%80%82)

您应替换这些已弃用的图标，这将完全消除日志条目以及向 `/logs` 发出的 POST 请求。此外，旧名称的备用方案也将在不久后（即未来几周内）被移除。

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2020年三月26日 07:54 UTC](https://meta.discourse.org/t/icon-deprecation-warnings-causing-rate-limiting-issues/145586/6 "2020-03-26T07:54:38Z")

</div>

感谢 @pmusaraj，我将进一步调查可能导致此问题的原因。

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2020年三月28日 17:16 UTC](https://meta.discourse.org/t/icon-deprecation-warnings-causing-rate-limiting-issues/145586/7 "2020-03-28T17:16:15Z")

</div>

好的，我找到了一些内容。但这并不是 @DaveK 遇到的问题。

> [@pmusaraj](#):
>
> 图标弃用警告已实施速率限制

确实实施了速率限制，但 Logster 进一步限制了这些警告，每个 IP 每分钟仅允许一次，导致在单次页面加载中出现多个弃用警告时返回 429 错误。

这实际上会导致弃用警告丢失，使得 /logs 作为查找所有弃用项的工具价值降低……

> 每个 IP 对所有 JS 错误报告实施每分钟一次的速率限制

> <https://github.com/discourse/discourse/commit/8db38de9d7d47b8c931ae0cc409c5550e37653b7#>
>
> This adds a 1 minute rate limit to all JS error reporting per IP. Previously
> we …would only use the global rate limit.
> 
> This also introduces DISCOURSE\_ENABLE\_JS\_ERROR\_REPORTING, if it is set to
> false then no JS error reporting will be allowed on the site.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2024年四月9日 19:48 UTC](https://meta.discourse.org/t/icon-deprecation-warnings-causing-rate-limiting-issues/145586/8 "2024-04-09T19:48:04Z")

</div>


