Skip to content

Commit 6a09bc4

Browse files
authored
add support for fetch timeout control for node_helpers, fix timeouts on armv6l (#3660)
user reporting slow/no connection/timeout errors on armv6l for calendar, and newsfeed we can increase the timeout by adding calls to the undici lib, but it requires node 20.18.1 or above. this adds the support for timeout (also environment variable to override if needed,, mmFetchTimeout (default 30 seconds) and updates the base node version
1 parent 2fb5143 commit 6a09bc4

File tree

6 files changed

+175
-162
lines changed

6 files changed

+175
-162
lines changed

.github/workflows/automated-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
timeout-minutes: 30
3939
strategy:
4040
matrix:
41-
node-version: [20.9.0, 20.x, 22.x, 23.x]
41+
node-version: [20.18.1, 20.x, 22.x, 23.x]
4242
steps:
4343
- name: "Checkout code"
4444
uses: actions/checkout@v4

.github/workflows/electron-rebuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
node-version: [20.9.0, 20.x, 22.x, 23.x]
11+
node-version: [20.18.1, 20.x, 22.x, 23.x]
1212
steps:
1313
- name: Checkout code
1414
uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ _This release is scheduled to be released on 2025-01-01._
2424
- [linter] Add linting for markdown files (#3646)
2525
- [calendar] Add ability to display end date for full date events, where end is not same day (showEnd=true) (#3650)
2626
- [core] Add text to the config.js.sample file about the locale variable (#3654, #3655)
27+
- [core] Add fetch timeout for all node_helpers (thru undici, forces node 20.18.1 minimum) to help on slower systems.
2728

2829
### Changed
2930

js/app.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ const Utils = require(`${__dirname}/utils`);
1111
const defaultModules = require(`${__dirname}/../modules/default/defaultmodules`);
1212
const { getEnvVarsAsObj } = require(`${__dirname}/server_functions`);
1313

14+
// used to control fetch timeout for node_helpers
15+
const { setGlobalDispatcher, Agent } = require("undici");
16+
// common timeout value, provide environment override in case
17+
const fetch_timeout = process.env.mmFetchTimeout !== undefined ? process.env.mmFetchTimeout : 30000;
18+
1419
// Get version number.
1520
global.version = require(`${__dirname}/../package.json`).version;
1621
global.mmTestMode = process.env.mmTestMode === "true" ? true : false;
@@ -295,6 +300,8 @@ function App () {
295300
}
296301
}
297302

303+
setGlobalDispatcher(new Agent({ connect: { timeout: fetch_timeout } }));
304+
298305
await loadModules(modules);
299306

300307
httpServer = new Server(config);

0 commit comments

Comments
 (0)