Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

merge: origin/main into fix/upload-queue-retry-budget

Richie McIlroy2f45d8041628
diff --cc apps/desktop-gpui/src/upload/queue.rs
index 119d98db6,fb64d771e..40733877c
--- a/apps/desktop-gpui/src/upload/queue.rs
+++ b/apps/desktop-gpui/src/upload/queue.rs
@@@ -653,21 -670,20 +688,25 @@@ impl<B: UploadBackend> Manager<B>
_ = cancellation(&mut cancelled) => Err("Upload paused; the local recording is preserved".to_string()),
}
})).catch_unwind().await.unwrap_or_else(|_| Err("The upload worker failed; the local recording is preserved".into()));
+ let paused = *cancelled.borrow() || upload.cancel.load(Ordering::Acquire);
upload.abort_segments().await;
+ match &result {
+ Ok(Some(delay)) => self.wake_after(*delay),
+ _ => self.forget_pending_rechecks(&state.video_id),
+ }
- if let Err(error) = result {
- if !*cancelled.borrow() {
- self.backend.notify_failure();
+ match result {
+ Err(error) if paused => {
+ tracing::info!(path = %project.display(), %error, "Instant upload paused");
}
- state.fail(error.clone(), now());
- if let Err(save_error) = write_state(&project, &state) {
- tracing::error!(%save_error, "Failed to persist upload retry state");
+ Err(error) => {
+ self.backend.notify_failure();
+ state.fail(error.clone(), now());
+ if let Err(save_error) = write_state(&project, &state) {
+ tracing::error!(%save_error, "Failed to persist upload retry state");
+ }
+ tracing::warn!(path = %project.display(), %error, "Instant upload remains local");
}
- Ok(()) => {}
- tracing::warn!(path = %project.display(), %error, "Instant upload remains local");
++ Ok(_) => {}
}
self.wake.notify_one();
}