-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use safe-timers only large than interval && add tests #21
Conversation
@atian25, thanks for your PR! By analyzing the history of the files in this pull request, we identified @dead-horse and @fengmk2 to be potential reviewers. |
agent.js
Outdated
@@ -106,15 +105,15 @@ function startCron(interval, listener) { | |||
} | |||
|
|||
function safeTimeout(fn, delay, ...args) { | |||
if (delay >= MAX_SAFE_TIME) { | |||
if (delay >= safetimers.maxInterval) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
额,不应该是小于么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-.-!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
果然是没有测试覆盖的肯定会有问题,我补下测试
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... 逻辑全反了
Codecov Report
@@ Coverage Diff @@
## master #21 +/- ##
========================================
+ Coverage 98.21% 100% +1.78%
========================================
Files 3 3
Lines 112 111 -1
========================================
+ Hits 110 111 +1
+ Misses 2 0 -2
Continue to review full report at Codecov.
|
5b8e487
to
5b27e8e
Compare
@dead-horse 再看看,测试过了 |
2.4.1 |
Checklist
npm test
passesAffected core subsystem(s)
Description of change