Skip to content

Commit

Permalink
fix: use queues to cache request tasks (#12)
Browse files Browse the repository at this point in the history
使用 [fastq](https://github.com/mcollina/fastq) 队列,对请求任务进行缓存,用于解决浏览器同时等待请求数过多而导致的  ERR_INSUFFICIENT_RESOURCES 错误。

Fixes #11 

/kind bug

测试方式:
1. 从 1.5/1.6 导出一份评论/文章数量较大的数据(1000+)
2. 打开 chrome 控制台
3. 在迁移插件页面执行导入操作。
4. 查看控制台请求,未修复版本为一次性创建所有请求。已修复版本使用队列之后将会持续创建请求。
5. 未修复版本处理大量数据时,部分数据浏览器会报错 ERR_INSUFFICIENT_RESOURCES。已修复版本会正确请求全部数据。

可测试 jar 包: [plugin-migrate-1.1.0-SNAPSHOT.jar.zip](https://github.com/halo-sigs/plugin-migrate/files/10763830/plugin-migrate-1.1.0-SNAPSHOT.jar.zip)

```release-note
解决 Chrome 浏览器报错 ERR_INSUFFICIENT_RESOURCES 的问题
```
  • Loading branch information
LIlGG authored Feb 21, 2023
1 parent 54d63a7 commit 0710a01
Show file tree
Hide file tree
Showing 5 changed files with 469 additions and 360 deletions.
1 change: 1 addition & 0 deletions console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@halo-dev/console-shared": "^2.0.0-rc.1",
"@vueuse/core": "^9.6.0",
"axios": "^1.2.0",
"fastq": "^1.15.0",
"lodash.groupby": "^4.6.0",
"performant-array-to-tree": "^1.11.0",
"vue": "^3.2.45",
Expand Down
10 changes: 5 additions & 5 deletions console/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0710a01

Please sign in to comment.