Skip to content

Commit

Permalink
Fix problem with multiple deletes in test (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
fhinkel authored May 21, 2018
1 parent e580c8d commit 3400fd4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compute/startup-script/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ function createVm(name, callback) {
console.log('Booting new VM with IP http://' + ip + '...');

// Ping the VM to determine when the HTTP server is ready.
let waiting = true;
const timer = setInterval(
ip => {
http
.get('http://' + ip, res => {
const statusCode = res.statusCode;
if (statusCode === 200) {
if (statusCode === 200 && waiting) {
waiting = false;
clearTimeout(timer);
// HTTP server is ready.
console.log('Ready!');
Expand Down

0 comments on commit 3400fd4

Please sign in to comment.