0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-07 23:06:50 -05:00
This commit is contained in:
David Sherret 2024-11-29 11:34:15 -05:00
parent b00d0f62b8
commit cc96872bd7

View file

@ -431,12 +431,9 @@ fn run_step(
let command = match metadata.timeout {
Some(timeout_seconds) => {
let timeout = std::time::Duration::from_secs(timeout_seconds as u64);
let remaining_timeout = match timeout.checked_sub(start_time.elapsed()) {
Some(timeout) => timeout,
None => {
panic!("Timed out after: {}s", timeout_seconds);
}
};
let remaining_timeout = timeout
.checked_sub(start_time.elapsed())
.ok_or_else(|| panic!("Timed out after: {}s", timeout_seconds));
command.timeout(remaining_timeout)
}
None => command,