Merge pull request #3822 from flaparoo/android-http-timeout
android: pass HTTP request timeout to Gadgetbridgemaster
commit
b63c819a0a
|
|
@ -46,3 +46,4 @@
|
||||||
arrival. (Needs Gadgetbridge nightly (either flavour) for now, or stable
|
arrival. (Needs Gadgetbridge nightly (either flavour) for now, or stable
|
||||||
version 85 when it's out)
|
version 85 when it's out)
|
||||||
0.43: Ensure listRecs doesn't list old-style recorded tracks (Otherwise Gadgetbridge fails parsing the filename)
|
0.43: Ensure listRecs doesn't list old-style recorded tracks (Otherwise Gadgetbridge fails parsing the filename)
|
||||||
|
0.44: Pass HTTP request timeout to Gadgetbridge
|
||||||
|
|
|
||||||
|
|
@ -321,6 +321,7 @@ exports.httpHandler = (url,options) => {
|
||||||
if (options.method) req.method = options.method;
|
if (options.method) req.method = options.method;
|
||||||
if (options.body) req.body = options.body;
|
if (options.body) req.body = options.body;
|
||||||
if (options.headers) req.headers = options.headers;
|
if (options.headers) req.headers = options.headers;
|
||||||
|
req.timeout = options.timeout || 30000;
|
||||||
exports.gbSend(req);
|
exports.gbSend(req);
|
||||||
//create the promise
|
//create the promise
|
||||||
var promise = new Promise(function(resolve,reject) {
|
var promise = new Promise(function(resolve,reject) {
|
||||||
|
|
@ -329,7 +330,7 @@ exports.httpHandler = (url,options) => {
|
||||||
//if after "timeoutMillisec" it still hasn't answered -> reject
|
//if after "timeoutMillisec" it still hasn't answered -> reject
|
||||||
delete Bangle.httpRequest[options.id];
|
delete Bangle.httpRequest[options.id];
|
||||||
reject("Timeout");
|
reject("Timeout");
|
||||||
},options.timeout||30000)};
|
},req.timeout+500)};
|
||||||
});
|
});
|
||||||
return promise;
|
return promise;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "android",
|
"id": "android",
|
||||||
"name": "Android Integration",
|
"name": "Android Integration",
|
||||||
"shortName": "Android",
|
"shortName": "Android",
|
||||||
"version": "0.43",
|
"version": "0.44",
|
||||||
"description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.",
|
"description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"tags": "tool,system,messages,notifications,gadgetbridge",
|
"tags": "tool,system,messages,notifications,gadgetbridge",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue