Skip to content

Commit 0d66793

Browse files
committed
sscweb timeout
1 parent 81c4a47 commit 0d66793

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

metadata/SSCWeb/SSCWeb2HAPI.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ SSCWeb2HAPI(function (err, catalog) {
4040
function getUrlo(cb) {
4141
// Fetches urlo and writes it to cfile
4242
console.error("Getting " + urlo)
43-
request({uri: urlo, strictSSL: false},
43+
request({uri: urlo, strictSSL: false, "timeout": 10000},
4444
function (error, response, body) {
45-
if (error) {
45+
if (error || response.statusCode !== 200) {
4646
console.error(error);
4747
if (fs.existsSync(cfile)) {
4848
console.error("Could not get " + urlo + ". Returning cached metadata.")
@@ -145,9 +145,8 @@ function makeHAPI(jsonraw, cb) {
145145
catalog[i]["info"]["parameters"][j]["type"] = "string";
146146
catalog[i]["info"]["parameters"][j]["length"] = len;
147147
}
148-
148+
149149
}
150-
151150

152151
var Time = {
153152
"name": "Time",

0 commit comments

Comments
 (0)