Skip to content

Commit

Permalink
feat: Remove executor metrics on stop
Browse files Browse the repository at this point in the history
  • Loading branch information
morgsmccauley committed Feb 13, 2024
1 parent 439d760 commit bd8aeeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions runner/src/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ export const registerWorkerMetrics = (workerId: number, metrics: string): void =
workerMetrics[workerId] = metrics;
};

export const deregisterWorkerMetrics = (workerId: number): void => {
workerMetrics[workerId] = undefined;
};

export const startServer = async (): Promise<void> => {
const app = express();

Expand Down
2 changes: 2 additions & 0 deletions runner/src/stream-handler/stream-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export default class StreamHandler {
}

async stop (): Promise<void> {
deregisterWorkerMetrics(this.worker.threadId);

await this.worker.terminate();
}

Expand Down

0 comments on commit bd8aeeb

Please sign in to comment.