send telemetry synchronously in a background thread

This commit is contained in:
Karl Seguin
2025-03-10 14:17:23 +08:00
parent a6a8130234
commit a5ee34a2db
2 changed files with 3 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ pub const App = struct {
loop.* = try Loop.init(allocator);
errdefer loop.deinit();
const telemetry = Telemetry.init(allocator, loop, run_mode);
const telemetry = Telemetry.init(allocator, run_mode);
errdefer telemetry.deinit();
return .{

View File

@@ -29,7 +29,7 @@ fn TelemetryT(comptime P: type) type {
const Self = @This();
pub fn init(allocator: Allocator, loop: *Loop, run_mode: RunMode) Self {
pub fn init(allocator: Allocator, run_mode: RunMode) Self {
const disabled = std.process.hasEnvVarConstant("LIGHTPANDA_DISABLE_TELEMETRY");
if (builtin.mode != .Debug and builtin.is_test == false) {
log.info("telemetry {s}", .{if (disabled) "disabled" else "enabled"});
@@ -38,8 +38,8 @@ fn TelemetryT(comptime P: type) type {
return .{
.disabled = disabled,
.run_mode = run_mode,
.provider = try P.init(allocator),
.iid = if (disabled) null else getOrCreateId(),
.provider = try P.init(allocator, loop),
};
}