fix: handle download not found exception in HttpDownloader and enforce IPv4 in HTTP agents

This commit is contained in:
Moyasee
2026-01-03 01:08:25 +02:00
parent 2bc0266775
commit de483da51c
5 changed files with 29 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import axios from "axios";
import http from "http";
import cp from "node:child_process";
import fs from "node:fs";
@@ -31,6 +32,9 @@ export class PythonRPC {
public static readonly RPC_PORT = "8084";
public static readonly rpc = axios.create({
baseURL: `http://localhost:${this.RPC_PORT}`,
httpAgent: new http.Agent({
family: 4, // Force IPv4
}),
});
private static pythonProcess: cp.ChildProcess | null = null;