Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchoz49 committed May 5, 2020
1 parent 87629aa commit 211b40f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function benchRead () {
if (err) throw err
if (offset >= 512 * 1024 * 1024) {
console.timeEnd('512mb read')
console.log('### EXIT')
console.log('BROWSER_RUNNER_EXIT')
return
}
st.read(offset += buf.length, 65536, onread)
Expand Down
2 changes: 1 addition & 1 deletion browser-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function runTests (ev) {

page.on('console', msg => {
msg = msg.text()
if (msg.includes('### EXIT')) {
if (msg.includes('BROWSER_RUNNER_EXIT')) {
shutdown()
} else {
results.push(`${msg}\n`)
Expand Down
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ ReadRequest.prototype.onread = function (err, buf) {
const req = this.req

if (err && this.retry) {
if (err.name === 'NotReadableError') {
this.file.clearFile()
this.run(req)
return
}

this.retry = false
if (this.lock(this)) {
this.file.clearFile()
Expand All @@ -254,12 +260,6 @@ ReadRequest.prototype.onread = function (err, buf) {
return
}

if (err && err.name === 'NotReadableError') {
this.file.clearFile()
this.run(req)
return
}

this.req = null
this.pool.push(this)
this.retry = true
Expand Down

0 comments on commit 211b40f

Please sign in to comment.