Skip to content

Commit 419b80b

Browse files
fix waitCounter with readyfile
1 parent 369587b commit 419b80b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/tunnel-launcher.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,24 +113,25 @@ function run (options, callback) {
113113
}
114114

115115
const readyFile = path.join(os.tmpdir(), 'testingbot.ready')
116-
117-
function checkReadyFile(waitCounter = 0) {
116+
let waitCounter = 0
117+
118+
function checkReadyFile() {
118119
fs.access(readyFile, fs.constants.F_OK, (error) => {
119120
if (!error) {
120121
clearInterval(readyFileChecker)
121122
return onReady()
122123
}
123-
124+
125+
waitCounter += 1
126+
124127
if (waitCounter > 90) {
125128
clearInterval(readyFileChecker)
126129
return onError(waitCounter)
127130
}
128-
129-
waitCounter += 1
130131
})
131132
}
132-
133-
const readyFileChecker = setInterval(() => checkReadyFile(), 1000)
133+
134+
const readyFileChecker = setInterval(checkReadyFile, 1000)
134135

135136
const args = createArgs(options)
136137

0 commit comments

Comments
 (0)