Skip to content

Commit 276eaa2

Browse files
committed
android: pass HTTP request timeout to Gadgetbridge
1 parent a243ac6 commit 276eaa2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/android/lib.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ exports.httpHandler = (url,options) => {
321321
if (options.method) req.method = options.method;
322322
if (options.body) req.body = options.body;
323323
if (options.headers) req.headers = options.headers;
324+
req.timeout = options.timeout || 30000;
324325
exports.gbSend(req);
325326
//create the promise
326327
var promise = new Promise(function(resolve,reject) {
@@ -329,7 +330,7 @@ exports.httpHandler = (url,options) => {
329330
//if after "timeoutMillisec" it still hasn't answered -> reject
330331
delete Bangle.httpRequest[options.id];
331332
reject("Timeout");
332-
},options.timeout||30000)};
333+
},req.timeout)};
333334
});
334335
return promise;
335336
};

0 commit comments

Comments
 (0)