Skip to content

Commit 7c1b908

Browse files
cleanup
1 parent 07cf2b8 commit 7c1b908

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

apps/desktop/src-tauri/src/upload.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,16 @@ pub async fn upload_video(
153153
async_capture_event(match &video_result {
154154
Ok(took) => {
155155
let mut e = posthog_rs::Event::new_anon("multipart_upload_complete");
156-
e.insert_prop("took", took.as_millis());
156+
e.insert_prop("took", took.as_millis())
157+
.map_err(|err| error!("Error adding PostHog property: {err:?}"))
158+
.ok();
157159
e
158160
}
159161
Err(err) => {
160162
let mut e = posthog_rs::Event::new_anon("multipart_upload_failed");
161-
e.insert_prop("error", err.to_string());
163+
e.insert_prop("error", err.to_string())
164+
.map_err(|err| error!("Error adding PostHog property: {err:?}"))
165+
.ok();
162166
e
163167
}
164168
});
@@ -206,6 +210,7 @@ pub async fn upload_image(
206210
.map_err(Into::into);
207211
}
208212

213+
let start = Instant::now();
209214
let file_name = file_path
210215
.file_name()
211216
.and_then(|name| name.to_str())
@@ -378,12 +383,16 @@ impl InstantMultipartUpload {
378383
async_capture_event(match &result {
379384
Ok(took) => {
380385
let mut e = posthog_rs::Event::new_anon("multipart_upload_complete");
381-
e.insert_prop("took", took.as_millis());
386+
e.insert_prop("took", took.as_millis())
387+
.map_err(|err| error!("Error adding PostHog property: {err:?}"))
388+
.ok();
382389
e
383390
}
384391
Err(err) => {
385392
let mut e = posthog_rs::Event::new_anon("multipart_upload_failed");
386-
e.insert_prop("error", err.to_string());
393+
e.insert_prop("error", err.to_string())
394+
.map_err(|err| error!("Error adding PostHog property: {err:?}"))
395+
.ok();
387396
e
388397
}
389398
});

0 commit comments

Comments
 (0)