mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 10:33:49 +00:00
## Summary When refactoring the addition PR I accidentally introduced a bug where the debug message would not be output if the default value is used. cc @zanieb
This commit is contained in:
parent
bdb8c2646a
commit
3884ab5715
1 changed files with 15 additions and 14 deletions
|
@ -91,27 +91,28 @@ pub async fn compile_tree(
|
|||
let pip_compileall_py = tempdir.path().join("pip_compileall.py");
|
||||
|
||||
let timeout: Option<Duration> = match env::var(EnvVars::UV_COMPILE_BYTECODE_TIMEOUT) {
|
||||
Ok(value) => {
|
||||
if value == "0" {
|
||||
debug!("Disabling bytecode compilation timeout");
|
||||
None
|
||||
} else {
|
||||
if let Ok(duration) = value.parse::<u64>().map(Duration::from_secs) {
|
||||
debug!(
|
||||
"Using bytecode compilation timeout of {}s",
|
||||
duration.as_secs()
|
||||
);
|
||||
Some(duration)
|
||||
} else {
|
||||
Ok(value) => match value.as_str() {
|
||||
"0" => None,
|
||||
_ => match value.parse::<u64>().map(Duration::from_secs) {
|
||||
Ok(duration) => Some(duration),
|
||||
Err(_) => {
|
||||
return Err(CompileError::EnvironmentError {
|
||||
var: "UV_COMPILE_BYTECODE_TIMEOUT",
|
||||
message: format!("Expected an integer number of seconds, got \"{value}\""),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
Err(_) => Some(DEFAULT_COMPILE_TIMEOUT),
|
||||
};
|
||||
if let Some(duration) = timeout {
|
||||
debug!(
|
||||
"Using bytecode compilation timeout of {}s",
|
||||
duration.as_secs()
|
||||
);
|
||||
} else {
|
||||
debug!("Disabling bytecode compilation timeout");
|
||||
}
|
||||
|
||||
debug!("Starting {} bytecode compilation workers", worker_count);
|
||||
let mut worker_handles = Vec::new();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue