Closed mikeshi80 closed 3 months ago
Maybe std::time::SystemTime::now
is the right option, not std::time::Instant::now
I also encountered the same problem on the Windows system. Later I checked GPT and he replied that it was possible that the MAX_WARNING_REPEAT setting was too large, so I changed const MAX_WARNING_REPEAT: Duration = Duration::from_secs(3_600); to const MAX_WARNING_REPEAT: Duration = Duration::from_secs(3_60);This problem is solved. I don’t know if there are any other problems with this solution.
https://github.com/huggingface/llm-ls/blob/f58085b8127dc09ae09645e04019a668a85e4976/crates/llm-ls/src/main.rs#L795
Instant::now()
maybe return a value smaller thanMAX_WARNING_REPEAT
(3600s) in my Win11, and it will cause thechecked_sub
return None, that make program show error message "instant to be in bounds" and exit exceptionally.I think it could be the reason: https://doc.rust-lang.org/std/time/struct.Instant.html#underlying-system-calls
Windows use
QueryPerformanceCounter
as underlying system call.My OS is Win11 Home Edition, 23H2 version.