Make the clock replaceable for tests
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 40/100
Hướng nghiên cứu
Start at src/TickerNet.Utilities/Interfaces/ITickerClock.cs and the AddTickerNet registration that wires it as a singleton, then grep src/ for DateTime.UtcNow and DateTime.Now to enumerate every scheduling decision still reading the wall clock, especially the background services and the execution path. Decide whether to thread ITickerClock through or adapt .NET's TimeProvider, noting the ADR required in site/decisions/ for any public API change. Done when the grep finds no scheduling decisions outside the clock, a fake-clock test advances time and sees a due job fire, and the docs show registering your own clock after AddTickerNet.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What's missing
ITickerClock (src/TickerNet.Utilities/Interfaces/ITickerClock.cs) is public and registered as a singleton, and the managers and persistence providers use it. But the scheduler background services and parts of the execution path still read DateTime.UtcNow directly, and replacing the clock isn't documented or tested. So tests can't control time reliably.
Proposal
- Use
ITickerClockeverywhere TickerNet reads the current time, or switch to .NET'sTimeProviderand keepITickerClockas an adapter. - Document that registering your own clock after
AddTickerNetreplaces the default, with an example for tests. - Add a test that moves a fake clock forward and checks that a due job runs.
Done when: a search for DateTime.UtcNow / DateTime.Now in src/ finds no scheduling decisions outside the clock, and the docs show how to replace it.
Part of the TickerQ comparison roadmap. Design it from this description only: never read or copy code, tests or docs from TickerQ 10.5.0 or later, which is under a commercial license (see CONTRIBUTING.md). If it adds or changes public API, add an ADR in site/decisions/ and list the API in the pull request. Comment here if you'd like to pick it up, and ask anything in Discussions.
- Ngôn ngữ chính
- C#
- Star
- 0
- Fork
- 2
- Merge trung bình
- 1 giờ 8 phút
- Pull request đã merge (30 ngày)
- 24
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TickerNet/TickerNet
-
.NET bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add TickerResult.EnsureSuccess()Đang mở.NET enhancement good first issue roadmap
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Document PathBase inside the dashboard branch and WebDAV on IISCó thể đã có người làm @harryhawwy69 đã nhận hôm nay. Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 40/100
Maintainer thường phản hồi trong vòng 1 ngày
-
TickerFunctionProvider's registry is publicly writableCó thể đã có người làm @harryhawwy69 đã nhận hôm nay. Đang mở.NET bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Cron editor accepts 7 for Sunday, then saving fails with a generic errorCó thể đã có người làm @harryhawwy69 đã nhận hôm nay. Đang mởbug good first issue javascript
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TickerNet/TickerNet
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
dotnet-outdated/dotnet-outdated#871 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage/untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
unoplatform/uno#26676 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[问题] 导出文件时,提示后面还有1243390911步Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
jhaizhou-ops/S2Arm#2177 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-CodeGen-coreclr untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
dotnet/runtime#138181 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CO spearhead is too loudĐang mởS: Untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 2 ngày