mirror of
https://github.com/rclone/rclone.git
synced 2025-02-21 08:49:39 +08:00
Revert "cmd: shorten the locking window when using --progress to avoid deadlock"
This reverts commit fdef567da603d26eb2b348e23a2636b9991c7188. The problem turned out to be elsewhere.
This commit is contained in:
parent
99b3154abd
commit
9d1fb2f4e7
@ -84,6 +84,9 @@ var (
|
||||
|
||||
// printProgress prints the progress with an optional log
|
||||
func printProgress(logMessage string) {
|
||||
progressMu.Lock()
|
||||
defer progressMu.Unlock()
|
||||
|
||||
var buf bytes.Buffer
|
||||
w, h, err := terminal.GetSize(int(os.Stdout.Fd()))
|
||||
if err != nil {
|
||||
@ -97,10 +100,6 @@ func printProgress(logMessage string) {
|
||||
buf.WriteString(s)
|
||||
}
|
||||
|
||||
// Lock from here to prevent terminal corruption
|
||||
progressMu.Lock()
|
||||
progressMu.Unlock()
|
||||
|
||||
if logMessage != "" {
|
||||
out("\n")
|
||||
out(moveUp)
|
||||
|
Loading…
x
Reference in New Issue
Block a user