Skip to content

Commit 356a90b

Browse files
committed
logs for optional services
1 parent c08c3b4 commit 356a90b

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

apps/supervisor/src/index.ts

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,31 @@ class ManagedSupervisor {
4949
const workloadApiPortExternal = env.TRIGGER_WORKLOAD_API_PORT_EXTERNAL;
5050

5151
if (env.POD_CLEANER_ENABLED) {
52+
this.logger.log("[ManagedWorker] 🧹 Pod cleaner enabled", {
53+
namespace: env.KUBERNETES_NAMESPACE,
54+
batchSize: env.POD_CLEANER_BATCH_SIZE,
55+
intervalMs: env.POD_CLEANER_INTERVAL_MS,
56+
});
5257
this.podCleaner = new PodCleaner({
5358
namespace: env.KUBERNETES_NAMESPACE,
5459
batchSize: env.POD_CLEANER_BATCH_SIZE,
5560
intervalMs: env.POD_CLEANER_INTERVAL_MS,
5661
});
62+
} else {
63+
this.logger.warn("[ManagedWorker] Pod cleaner disabled");
5764
}
5865

5966
if (env.FAILED_POD_HANDLER_ENABLED) {
67+
this.logger.log("[ManagedWorker] 🔁 Failed pod handler enabled", {
68+
namespace: env.KUBERNETES_NAMESPACE,
69+
reconnectIntervalMs: env.FAILED_POD_HANDLER_RECONNECT_INTERVAL_MS,
70+
});
6071
this.failedPodHandler = new FailedPodHandler({
6172
namespace: env.KUBERNETES_NAMESPACE,
6273
reconnectIntervalMs: env.FAILED_POD_HANDLER_RECONNECT_INTERVAL_MS,
6374
});
75+
} else {
76+
this.logger.warn("[ManagedWorker] Failed pod handler disabled");
6477
}
6578

6679
if (this.warmStartUrl) {
@@ -299,13 +312,9 @@ class ManagedSupervisor {
299312
async start() {
300313
this.logger.log("[ManagedWorker] Starting up");
301314

302-
if (this.podCleaner) {
303-
await this.podCleaner.start();
304-
}
305-
306-
if (this.failedPodHandler) {
307-
await this.failedPodHandler.start();
308-
}
315+
// Optional services
316+
await this.podCleaner?.start();
317+
await this.failedPodHandler?.start();
309318

310319
if (env.TRIGGER_WORKLOAD_API_ENABLED) {
311320
this.logger.log("[ManagedWorker] Workload API enabled", {
@@ -319,21 +328,16 @@ class ManagedSupervisor {
319328
}
320329

321330
await this.workerSession.start();
322-
323331
await this.httpServer.start();
324332
}
325333

326334
async stop() {
327335
this.logger.log("[ManagedWorker] Shutting down");
328336
await this.httpServer.stop();
329337

330-
if (this.podCleaner) {
331-
await this.podCleaner.stop();
332-
}
333-
334-
if (this.failedPodHandler) {
335-
await this.failedPodHandler.stop();
336-
}
338+
// Optional services
339+
await this.podCleaner?.stop();
340+
await this.failedPodHandler?.stop();
337341
}
338342
}
339343

0 commit comments

Comments
 (0)