Skip to content

Commit

Permalink
ignore PCL drop connection
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed Jul 4, 2022
1 parent a0c2175 commit a7e8ebc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,12 @@ export class Cluster {
}
res.set('x-bmclapi-hash', hash)
return res.sendFile(path, {maxAge: '30d'}, (err) => {
if (!err || err?.message === 'Request aborted') {
if (!err || err?.message === 'Request aborted' || err?.message === 'write EPIPE') {
this.counters.bytes += parseInt(res.getHeader('content-length').toString(), 10) || 0
this.counters.hits++
} else {
if (err) return next(err)
}
if (err) return next(err)
})
} catch (err) {
if (err instanceof HTTPError) {
Expand Down

0 comments on commit a7e8ebc

Please sign in to comment.