优化结构

This commit is contained in:
Yvan
2026-08-22 22:34:33 +08:00
parent 0126995090
commit b18baf1547
26 changed files with 501 additions and 80 deletions
+8
View File
@@ -43,6 +43,14 @@ func composeStreams(
errCh <- nil
}()
putErr := put(ctx, destination, reader)
// A failed destination may stop reading before the producer reaches EOF.
// Close the pipe reader in that case so the producer's next write returns
// instead of leaving the goroutine blocked forever.
if putErr != nil {
_ = reader.CloseWithError(putErr)
} else {
_ = reader.Close()
}
composeErr := <-errCh
if putErr != nil {
_ = remove(ctx, destination)