Skip to content

Commit b63c819

Browse files
authored
Merge pull request #3822 from flaparoo/android-http-timeout
android: pass HTTP request timeout to Gadgetbridge
2 parents 1e5ce20 + 3edf10f commit b63c819

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

apps/android/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@
4646
arrival. (Needs Gadgetbridge nightly (either flavour) for now, or stable
4747
version 85 when it's out)
4848
0.43: Ensure listRecs doesn't list old-style recorded tracks (Otherwise Gadgetbridge fails parsing the filename)
49+
0.44: Pass HTTP request timeout to Gadgetbridge

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+500)};
333334
});
334335
return promise;
335336
};

apps/android/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "android",
33
"name": "Android Integration",
44
"shortName": "Android",
5-
"version": "0.43",
5+
"version": "0.44",
66
"description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.",
77
"icon": "app.png",
88
"tags": "tool,system,messages,notifications,gadgetbridge",

0 commit comments

Comments
 (0)