fix: ensure timeline.close is set (#113)

* fix(test): dns4 isnt a valid tcp multiaddr

It should be resolved first

* fix: ensure timeline.close is set on the multiaddrConn

* chore: add docs to gitignore

They are generated and uploaded on release
This commit is contained in:
Jacob Heun
2019-09-19 15:20:54 +02:00
committed by GitHub
parent 872e15af46
commit 605ee279ae
4 changed files with 13 additions and 4 deletions

View File

@ -79,5 +79,14 @@ module.exports = (socket, options) => {
}
}
socket.once('close', () => {
// In instances where `close` was not explicitly called,
// such as an iterable stream ending, ensure we have set the close
// timeline
if (!maConn.timeline.close) {
maConn.timeline.close = Date.now()
}
})
return maConn
}