From 47dce1a63c9b2407298cf7eb2af91b46e19abfb8 Mon Sep 17 00:00:00 2001 From: Drew Nutter Date: Fri, 22 Dec 2023 16:52:19 -0500 Subject: [PATCH] fix(prometheus): join prometheus server thread on exit --- src/cmd/cmd.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cmd/cmd.zig b/src/cmd/cmd.zig index 8b147766b..bc29717d5 100644 --- a/src/cmd/cmd.zig +++ b/src/cmd/cmd.zig @@ -89,7 +89,7 @@ fn gossip(_: []const []const u8) !void { // var logger: Logger = .noop; - _ = try spawnMetrics(gpa_allocator); + const metrics_thread = try spawnMetrics(gpa_allocator); var my_keypair = try getOrInitIdentity(gpa_allocator, logger); @@ -134,6 +134,7 @@ fn gossip(_: []const []const u8) !void { ); handle.join(); + metrics_thread.detach(); } /// Initializes the global registry. Returns error if registry was already initialized.