refactor: Optimize document navigation logic and improve background s…#31
Merged
Merged
Conversation
…ervice timer handling
There was a problem hiding this comment.
Pull request overview
该 PR 主要围绕两块:一是优化文档站点(Jekyll)在 docs/ 下的同级/上一篇下一篇导航计算逻辑;二是调整两个后台服务的 Timer 回调写法以改进空引用/可空签名处理(去掉不必要的 null-forgiving)。
Changes:
- 将后台服务
Timer回调从DoWork!调整为直接方法组DoWork,并把回调参数改为object?以匹配TimerCallback的可空签名。 - 重构
_layouts/default.html的文档导航:改为先收集同目录页面并统计sibling_count,再渲染“继续阅读”和 pager。 - 小幅整理空行/文件头(去 BOM/缩进差异)。
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/MS.Microservice.Web/Application/BackgroundServices/HighPerformanceBackgroundService.cs | 调整 Timer 回调签名与绑定方式,改善可空与委托绑定一致性 |
| src/MS.Microservice.Web/Application/BackgroundServices/BadPracticeBackgroundService.cs | 同步调整 Timer 回调签名与绑定方式 |
| _layouts/default.html | 重构 docs 同目录页面导航与上一篇/下一篇渲染逻辑 |
Comment on lines
+45
to
48
| private void DoWork(object? state) | ||
| { | ||
| DoWorkAsync(_cancellationToken).ContinueWith(_ => { }); | ||
| } |
Comment on lines
+39
to
42
| private void DoWork(object? state) | ||
| { | ||
| ExecuteAsync(CancellationToken.None).ContinueWith(_ => { }); | ||
| } |
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.
…ervice timer handling