Skip to content

Commit

Permalink
Merge pull request #2751 from balena-io/drivelist-v12
Browse files Browse the repository at this point in the history
Update dependencies to get node-addon-api >=7.0.0 to fix builds on node 20.12.0
  • Loading branch information
flowzone-app[bot] authored Apr 9, 2024
2 parents 71345a8 + 04b4444 commit 3dac94d
Show file tree
Hide file tree
Showing 12 changed files with 483 additions and 2,079 deletions.
Empty file modified bin/dev.js
100644 → 100755
Empty file.
Empty file modified bin/run.js
100644 → 100755
Empty file.
13 changes: 0 additions & 13 deletions lib/utils/device/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
* limitations under the License.
*/
import * as _ from 'lodash';
import type { NodeJSSocketWithFileDescriptor } from 'net-keepalive';
import * as os from 'os';
import * as request from 'request';
import type * as Stream from 'stream';

Expand Down Expand Up @@ -214,17 +212,6 @@ export class DeviceAPI {
}
try {
res.socket.setKeepAlive(true, 1000);
if (os.platform() !== 'win32') {
const NetKeepalive = await import('net-keepalive');
// Certain versions of typescript won't convert
// this automatically
const sock = res.socket as any as NodeJSSocketWithFileDescriptor;
// We send a tcp keepalive probe once every 5 seconds
NetKeepalive.setKeepAliveInterval(sock, 5000);
// After 5 failed probes, the connection is marked as
// closed
NetKeepalive.setKeepAliveProbes(sock, 5);
}
} catch (error) {
reject(error);
}
Expand Down
Loading

0 comments on commit 3dac94d

Please sign in to comment.