Skip to content

Commit

Permalink
chore: pr review - hold socket listener until dequeued
Browse files Browse the repository at this point in the history
  • Loading branch information
calebboyd committed Apr 5, 2021
1 parent fb4ef52 commit dc18131
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ function attachFinishedListener (msg, callback) {
var finished = false

function onFinish (error) {
if (finished) return eeSocket.cancel()
eeMsg.cancel()
eeSocket.cancel()

finished = true
callback(error)
Expand All @@ -121,7 +121,7 @@ function attachFinishedListener (msg, callback) {

if (msg.socket) {
// socket already assigned
defer(onSocket, msg.socket)
onSocket(msg.socket)
return
}

Expand Down

0 comments on commit dc18131

Please sign in to comment.