forked from SolrNet/SolrNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpingsolr.js
More file actions
28 lines (27 loc) · 716 Bytes
/
pingsolr.js
File metadata and controls
28 lines (27 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function ping(url) {
var request = new ActiveXObject('MSXML2.XMLHTTP.3.0');
request.open('GET', url, false);
try {
request.send();
return request.status == 200;
} catch (e) {
return false;
}
}
function pingUntilOK(url) {
for (var i = 0; i < 10; i++)
if (ping(url))
return true;
return false;
}
WScript.Echo('Waiting for Solr to start up...');
if (!pingUntilOK('http://localhost:8983/solr')) {
WScript.Echo('Solr did not start up successfully. Please see the log.');
WScript.Quit(1);
}
WScript.Echo('Waiting for web app to start up...');
if (!pingUntilOK('http://localhost:8082')) {
WScript.Echo('Web app did not start up successfully. Please see the log.');
WScript.Quit(1);
}
WScript.Quit(0);