We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b1481cf commit 78428dfCopy full SHA for 78428df
1 file changed
compute/startup-script/index.js
@@ -66,12 +66,14 @@ function createVm(name, callback) {
66
console.log('Booting new VM with IP http://' + ip + '...');
67
68
// Ping the VM to determine when the HTTP server is ready.
69
+ let waiting = true;
70
const timer = setInterval(
71
ip => {
72
http
73
.get('http://' + ip, res => {
74
const statusCode = res.statusCode;
- if (statusCode === 200) {
75
+ if (statusCode === 200 && waiting) {
76
+ waiting = false;
77
clearTimeout(timer);
78
// HTTP server is ready.
79
console.log('Ready!');
0 commit comments