mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 23:23:28 +00:00
send telemetry synchronously in a background thread
This commit is contained in:
@@ -23,7 +23,7 @@ pub const App = struct {
|
|||||||
loop.* = try Loop.init(allocator);
|
loop.* = try Loop.init(allocator);
|
||||||
errdefer loop.deinit();
|
errdefer loop.deinit();
|
||||||
|
|
||||||
const telemetry = Telemetry.init(allocator, loop, run_mode);
|
const telemetry = Telemetry.init(allocator, run_mode);
|
||||||
errdefer telemetry.deinit();
|
errdefer telemetry.deinit();
|
||||||
|
|
||||||
return .{
|
return .{
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ fn TelemetryT(comptime P: type) type {
|
|||||||
|
|
||||||
const Self = @This();
|
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");
|
const disabled = std.process.hasEnvVarConstant("LIGHTPANDA_DISABLE_TELEMETRY");
|
||||||
if (builtin.mode != .Debug and builtin.is_test == false) {
|
if (builtin.mode != .Debug and builtin.is_test == false) {
|
||||||
log.info("telemetry {s}", .{if (disabled) "disabled" else "enabled"});
|
log.info("telemetry {s}", .{if (disabled) "disabled" else "enabled"});
|
||||||
@@ -38,8 +38,8 @@ fn TelemetryT(comptime P: type) type {
|
|||||||
return .{
|
return .{
|
||||||
.disabled = disabled,
|
.disabled = disabled,
|
||||||
.run_mode = run_mode,
|
.run_mode = run_mode,
|
||||||
|
.provider = try P.init(allocator),
|
||||||
.iid = if (disabled) null else getOrCreateId(),
|
.iid = if (disabled) null else getOrCreateId(),
|
||||||
.provider = try P.init(allocator, loop),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user