Skip to content

refactor: Optimize document navigation logic and improve background s…#31

Merged
MarsonShine merged 1 commit into
masterfrom
refactor/framework-optimization-from-review
Jun 25, 2026
Merged

refactor: Optimize document navigation logic and improve background s…#31
MarsonShine merged 1 commit into
masterfrom
refactor/framework-optimization-from-review

Conversation

@MarsonShine

Copy link
Copy Markdown
Owner

…ervice timer handling

Copilot AI review requested due to automatic review settings June 25, 2026 05:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(_ => { });
}
@MarsonShine MarsonShine merged commit 15acd40 into master Jun 25, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants