@wopr-network/platform-core 1.72.0 → 1.72.1
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/proxy/manager.js
CHANGED
|
@@ -206,8 +206,8 @@ export class ProxyManager {
|
|
|
206
206
|
await this.reload();
|
|
207
207
|
}
|
|
208
208
|
catch (err) {
|
|
209
|
+
logger.warn("Proxy manager failed to connect to Caddy — continuing without proxy management", { err });
|
|
209
210
|
await this.stop();
|
|
210
|
-
throw err;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
async stop() {
|
|
@@ -286,9 +286,10 @@ describe("ProxyManager", () => {
|
|
|
286
286
|
});
|
|
287
287
|
});
|
|
288
288
|
describe("start rollback on failure", () => {
|
|
289
|
-
it("calls stop() if reload fails during start()", async () => {
|
|
289
|
+
it("calls stop() and continues if reload fails during start()", async () => {
|
|
290
290
|
vi.mocked(fetch).mockRejectedValueOnce(new Error("connection refused"));
|
|
291
|
-
|
|
291
|
+
// start() should NOT throw — proxy failure is non-fatal
|
|
292
|
+
await expect(manager.start()).resolves.toBeUndefined();
|
|
292
293
|
expect(manager.isRunning).toBe(false);
|
|
293
294
|
});
|
|
294
295
|
});
|
package/dist/server/container.js
CHANGED
|
@@ -40,7 +40,9 @@ export async function buildContainer(bootConfig) {
|
|
|
40
40
|
if (!bootConfig.pool) {
|
|
41
41
|
const { migrate } = await import("drizzle-orm/node-postgres/migrator");
|
|
42
42
|
const path = await import("node:path");
|
|
43
|
-
const
|
|
43
|
+
const { fileURLToPath } = await import("node:url");
|
|
44
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
45
|
+
const migrationsFolder = path.resolve(__dirname, "..", "..", "drizzle", "migrations");
|
|
44
46
|
await migrate(db, { migrationsFolder });
|
|
45
47
|
}
|
|
46
48
|
// 4. Bootstrap product config from DB (auto-seeds from presets if needed)
|
package/package.json
CHANGED
|
@@ -379,10 +379,11 @@ describe("ProxyManager", () => {
|
|
|
379
379
|
});
|
|
380
380
|
|
|
381
381
|
describe("start rollback on failure", () => {
|
|
382
|
-
it("calls stop() if reload fails during start()", async () => {
|
|
382
|
+
it("calls stop() and continues if reload fails during start()", async () => {
|
|
383
383
|
vi.mocked(fetch).mockRejectedValueOnce(new Error("connection refused"));
|
|
384
384
|
|
|
385
|
-
|
|
385
|
+
// start() should NOT throw — proxy failure is non-fatal
|
|
386
|
+
await expect(manager.start()).resolves.toBeUndefined();
|
|
386
387
|
expect(manager.isRunning).toBe(false);
|
|
387
388
|
});
|
|
388
389
|
});
|
package/src/proxy/manager.ts
CHANGED
|
@@ -230,8 +230,8 @@ export class ProxyManager implements ProxyManagerInterface {
|
|
|
230
230
|
try {
|
|
231
231
|
await this.reload();
|
|
232
232
|
} catch (err) {
|
|
233
|
+
logger.warn("Proxy manager failed to connect to Caddy — continuing without proxy management", { err });
|
|
233
234
|
await this.stop();
|
|
234
|
-
throw err;
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
|
package/src/server/container.ts
CHANGED
|
@@ -131,7 +131,9 @@ export async function buildContainer(bootConfig: BootConfig): Promise<PlatformCo
|
|
|
131
131
|
if (!bootConfig.pool) {
|
|
132
132
|
const { migrate } = await import("drizzle-orm/node-postgres/migrator");
|
|
133
133
|
const path = await import("node:path");
|
|
134
|
-
const
|
|
134
|
+
const { fileURLToPath } = await import("node:url");
|
|
135
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
136
|
+
const migrationsFolder = path.resolve(__dirname, "..", "..", "drizzle", "migrations");
|
|
135
137
|
await migrate(db as never, { migrationsFolder });
|
|
136
138
|
}
|
|
137
139
|
|