Repository navigation
feat: 调整trpc生命周期 - #153
Merged
Merged
feat: 调整trpc生命周期#153
Conversation
… 监听器执行完;停止仍在 HIGHEST + 20000 最先执行。springmvc 路由导出也改成 tRPC 启动后才做;同时只处理所属上下文的事件,启动失败(含 Error)时回滚状态,用 destroy() 兜底停止,启动标记改为实例级。
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #153 +/- ##
=====================================================
- Coverage 86.03810% 84.16375% -1.87436%
- Complexity 4348 4397 +49
=====================================================
Files 436 461 +25
Lines 14382 14852 +470
Branches 1287 1328 +41
=====================================================
+ Hits 12374 12500 +126
- Misses 2008 2352 +344
🚀 New features to boost your workflow:
|
Collaborator
Author
一、核心目的:调整 tRPC 的启动和停止时机原来的问题
改法 把启动和停止拆成两个监听器,分别用不同的 order:
原来一个监听器同时处理两个事件,只能用同一个 order,没法做到"启动要晚、停止要早",所以需要拆开。 二、springmvc 导出逻辑独立出来原来: 问题:tRPC 启动改到 改法
三、健壮性修复(第 1、3、4、5 点)1. 只处理自己所属上下文的事件
3. 启动失败时回滚状态
4. refresh 失败时的兜底停止
5. 启动标记
四、文件清单修改的文件
新增的文件
五、验证情况
六、对使用方的影响(建议写进 CHANGELOG)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
把 tRPC 的启动和停止拆成两个监听器:启动推迟到 LOWEST - 20,等 RefreshScope 等 refresh监听器执行完;停止仍在 HIGHEST + 20000 最先执行。springmvc 路由导出也改成 tRPC 启动后才做;同时只处理所属上下文的事件,启动失败(含 Error)时回滚状态,用 destroy() 兜底停止,启动标记改为实例级。