diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserStatusBarComp.java b/app/src/main/java/io/xpipe/app/browser/BrowserStatusBarComp.java index b350ea074..88a2b08c5 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserStatusBarComp.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserStatusBarComp.java @@ -58,8 +58,8 @@ public class BrowserStatusBarComp extends SimpleComp { return null; } else { var expected = p.expectedTimeRemaining(); - var show = (p.getTotal() > 50_000_000 && p.elapsedTime().compareTo(Duration.of(200, ChronoUnit.MILLIS)) > 0) || expected.toMillis() > 5000; - var time = show ? HumanReadableFormat.duration(p.expectedTimeRemaining()) : "..."; + var show = p.elapsedTime().compareTo(Duration.of(200, ChronoUnit.MILLIS)) > 0 && (p.getTotal() > 50_000_000 || expected.toMillis() > 5000); + var time = show ? HumanReadableFormat.duration(p.expectedTimeRemaining()) : ""; return time; } }); diff --git a/core/src/main/java/io/xpipe/core/process/CommandControl.java b/core/src/main/java/io/xpipe/core/process/CommandControl.java index 7849cf087..1e4dc6070 100644 --- a/core/src/main/java/io/xpipe/core/process/CommandControl.java +++ b/core/src/main/java/io/xpipe/core/process/CommandControl.java @@ -8,6 +8,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.nio.charset.Charset; +import java.time.Duration; import java.util.Optional; import java.util.function.Consumer; import java.util.function.Function; @@ -59,6 +60,8 @@ public interface CommandControl extends ProcessControl { OutputStream startExternalStdin() throws Exception; + public void setExitTimeout(Duration duration); + boolean waitFor(); CommandControl withCustomCharset(Charset charset); diff --git a/core/src/main/java/io/xpipe/core/store/ConnectionFileSystem.java b/core/src/main/java/io/xpipe/core/store/ConnectionFileSystem.java index 6073bd7be..56dc9fdf0 100644 --- a/core/src/main/java/io/xpipe/core/store/ConnectionFileSystem.java +++ b/core/src/main/java/io/xpipe/core/store/ConnectionFileSystem.java @@ -1,13 +1,13 @@ package io.xpipe.core.store; +import com.fasterxml.jackson.annotation.JsonIgnore; import io.xpipe.core.process.CommandBuilder; import io.xpipe.core.process.ShellControl; - -import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Getter; import java.io.InputStream; import java.io.OutputStream; +import java.time.Duration; import java.util.List; import java.util.Optional; import java.util.stream.Stream; @@ -53,10 +53,9 @@ public class ConnectionFileSystem implements FileSystem { @Override public OutputStream openOutput(String file, long totalBytes) throws Exception { - return shellControl - .getShellDialect() - .createStreamFileWriteCommand(shellControl, file, totalBytes) - .startExternalStdin(); + var cmd = shellControl.getShellDialect().createStreamFileWriteCommand(shellControl, file, totalBytes); + cmd.setExitTimeout(Duration.ofMillis(Long.MAX_VALUE)); + return cmd.startExternalStdin(); } @Override