@opencompress/openclaw 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +10 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
// src/config.ts
|
|
9
|
-
var VERSION = "3.0.
|
|
9
|
+
var VERSION = "3.0.3";
|
|
10
10
|
var PROXY_PORT = 8401;
|
|
11
11
|
var PROXY_HOST = "127.0.0.1";
|
|
12
12
|
var OCC_API = "https://www.opencompress.ai/api";
|
|
@@ -132,7 +132,7 @@ function startProxy(getProviders2, getOccKey) {
|
|
|
132
132
|
server = http.createServer(async (req, res) => {
|
|
133
133
|
if (req.url === "/health" && req.method === "GET") {
|
|
134
134
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
135
|
-
res.end(JSON.stringify({ status: "ok", version:
|
|
135
|
+
res.end(JSON.stringify({ status: "ok", version: VERSION }));
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
if (req.url === "/provision" && req.method === "POST") {
|
|
@@ -304,6 +304,14 @@ function startProxy(getProviders2, getOccKey) {
|
|
|
304
304
|
server.on("error", (err) => {
|
|
305
305
|
if (err.code === "EADDRINUSE") {
|
|
306
306
|
server = null;
|
|
307
|
+
try {
|
|
308
|
+
const { execSync } = __require("child_process");
|
|
309
|
+
execSync(`lsof -i :${PROXY_PORT} -t | xargs kill -9 2>/dev/null`, { stdio: "ignore" });
|
|
310
|
+
} catch {
|
|
311
|
+
}
|
|
312
|
+
setTimeout(() => {
|
|
313
|
+
if (!server) startProxy(getProviders2, getOccKey);
|
|
314
|
+
}, 2e3);
|
|
307
315
|
}
|
|
308
316
|
});
|
|
309
317
|
return server;
|