fix(crypto-nodejs): Set KeepAlive to false since Node.js v19

Disable keepAlive in download-lib.js, allowing node bindings to work on Node.JS 19
This commit is contained in:
Ivan Enderlin
2022-10-31 14:35:57 +01:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -92,7 +92,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
node-version: [14.0, 16.0, 18.0]
node-version: [14.0, 16.0, 18.0, 19.0]
include:
- os: ubuntu-latest
os-name: 🐧

View File

@@ -1,3 +1,4 @@
const { Agent } = require('https');
const { DownloaderHelper } = require('node-downloader-helper');
const { version } = require("./package.json");
const { platform, arch } = process
@@ -22,6 +23,11 @@ function download_lib(libname) {
console.info(`Downloading lib ${libname} from ${url}`);
const dl = new DownloaderHelper(url, __dirname, {
override: true,
httpsRequestOptions: {
// Disable keepalive to prevent the process hanging open.
// https://github.com/matrix-org/matrix-rust-sdk/issues/1160
agent: new Agent({ keepAlive: false }),
},
});
dl.on('end', () => console.info('Download Completed'));