-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: close return promise #128
Conversation
@popomore, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fengmk2 and @dead-horse to be potential reviewers. |
return super | ||
.close() | ||
.then(() => { | ||
for (const logger of this.loggers.values()) { |
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.
windows 可能跟这个有关
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.
.values()
在 node 4.x 就支持了?
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 的方法
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.
喔噢
CI 挂了? |
return super | ||
.close() | ||
.then(() => { | ||
process.removeListener('uncaughtException', this._uncaughtExceptionHandler); |
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.
失败后不用 remove?
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.
这个 promise 不用 catch?
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.
使用的时候 catch
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.
这个我改下
return super | ||
.close() | ||
.then(() => { | ||
for (const logger of this.loggers.values()) { |
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.
.values()
在 node 4.x 就支持了?
有个问题还要修下 |
是因为使用了 node-homedir,无法用 env 来 mock HOME |
Current coverage is 95.74% (diff: 100%)@@ master #128 diff @@
==========================================
Files 33 33
Lines 821 823 +2
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 785 788 +3
+ Misses 36 35 -1
Partials 0 0
|
5a2dc3f
to
fb537b0
Compare
ci 经常挂掉, cnpm/npminstall#152 |
可能跟这个有关 isaacs/rimraf#72 |
48179ba
to
d0eeb90
Compare
难道跑过,先等着合影 |
+1 不容易啊,原来 windows 要求进程打开的文件句柄被关闭了才能删除文件,果然是传说中 windows 的文件 io 做得比较好。。 |
@@ -47,7 +48,8 @@ describe('test/app/middleware/site_file.test.js', () => { | |||
return request(app.callback()) | |||
.head('/robots.txt') | |||
.expect('content-length', '72') | |||
.expect('') // body must be empty for HEAD |
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.
这个不知道哪里改了
logger should close stream when app close
部分情况会有这个问题 |
不是很稳定,把延时时间再调长一点。 |
Windows 的 report 是不是也要等一下 |
这个差不多先合好了,不稳定的之后看看,合了才能改 mock。 |
+1 |
Checklist
npm test
passesAffected core subsystem(s)
close
Description of change
logger should close stream when app close