-
Notifications
You must be signed in to change notification settings - Fork 14
refactor: use async function and support egg@2 #13
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13 +/- ##
=======================================
Coverage 95.67% 95.67%
=======================================
Files 12 12
Lines 185 185
=======================================
Hits 177 177
Misses 8 8
Continue to review full report at Codecov.
|
@@ -37,11 +37,11 @@ class DayRotator extends Rotator { | |||
this.app.deprecate('[egg-logrotator] Do not use app.config.logger.rotateLogDirs, only rotate core loggers and custom loggers'); |
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.
先保留吧,�尽量让这个版本升级减少应用层感知到的 breaking change
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.
ok,上面那个 for...in
顺手改掉?
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.
for in 怎么了?
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.
不是推荐改 for...of
么?
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.
object 不能 for of,而且 node 8 这些性能问题应该也基本都没了
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.
那个是个 Map 来着,可以 for...of map.values()
嗯,那就这样吧
@@ -13,8 +13,8 @@ module.exports = app => { | |||
cron: '0 0 * * *', // run every day at 00:00 | |||
}, | |||
|
|||
* task() { | |||
yield rotator.rotate(); | |||
async task() { |
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.
要改为 class 形式呢? @popomore
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.
后面非 class 形式的要废掉么?这种简单的不想用 class
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.
应该会一直兼容吧,现在觉得 class 方式写起来不够简洁,那个 static get schedule() {}
挺丑的。。。 ES 还不支持 static const
3.0.0 |
Checklist
npm test
passesAffected core subsystem(s)
Description of change