Restore temp file initialization in telemetry code

This commit is contained in:
Mikayla 2024-01-12 21:37:09 -08:00
parent 78858d4d11
commit 1d7dc96135
No known key found for this signature in database

View File

@ -14,6 +14,7 @@ use sysinfo::{
};
use tempfile::NamedTempFile;
use util::http::HttpClient;
use util::ResultExt;
use util::{channel::ReleaseChannel, TryFutureExt};
use self::event_coalescer::EventCoalescer;
@ -167,6 +168,19 @@ impl Telemetry {
event_coalescer: EventCoalescer::new(),
}));
cx.background_executor()
.spawn({
let state = state.clone();
async move {
if let Some(tempfile) =
NamedTempFile::new_in(util::paths::CONFIG_DIR.as_path()).log_err()
{
state.lock().log_file = Some(tempfile);
}
}
})
.detach();
cx.observe_global::<SettingsStore>({
let state = state.clone();