Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <[email protected]>
  • Loading branch information
mcollina committed Nov 25, 2024
1 parent c4b46a7 commit f0055c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function createThreadInterceptor (opts) {
const port = roundRobin.next()

if (port[kAddress]) {

Check failure on line 44 in index.js

View workflow job for this annotation

GitHub Actions / test (20.x)

Block must not be padded by blank lines

Check failure on line 44 in index.js

View workflow job for this annotation

GitHub Actions / test (20.x)

Block must not be padded by blank lines

Check failure on line 44 in index.js

View workflow job for this annotation

GitHub Actions / test (18.x)

Block must not be padded by blank lines

Check failure on line 44 in index.js

View workflow job for this annotation

GitHub Actions / test (20.x)

Block must not be padded by blank lines

Check failure on line 44 in index.js

View workflow job for this annotation

GitHub Actions / test (20.x)

Block must not be padded by blank lines

return dispatch({ ...opts, origin: port[kAddress] }, handler)
}

Expand Down Expand Up @@ -201,10 +202,17 @@ function createThreadInterceptor (opts) {
inflight(err, res)
}
} else if (msg.type === 'address') {
// TODO(mcollina): verify the else clause
if (!msg.url) {
const roundRobinIndex = roundRobin.findIndex(port)
res.setAddress(url, roundRobinIndex, msg.address, forward)
} else {
const roundRobin = routes.get(msg.url)
if (!roundRobin) {
return
}

const roundRobinIndex = roundRobin.findIndex(port)
res.setAddress(msg.url, roundRobinIndex, msg.address, false)
}
}
})
Expand Down
1 change: 0 additions & 1 deletion test/fixtures/network-crash.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ app.get('/crash', async (request, reply) => {
// TODO(mcollina): there is a race condition here
const { replaceServer } = wire({ port: parentPort })
app.listen({ port: 0 }).then((url) => {
process._rawDebug('server started on', url)
replaceServer(url)
})

0 comments on commit f0055c7

Please sign in to comment.