Workaround for service starting before hwmon paths

Let the service fail when there are no hwmon paths yet.
This commit is contained in:
Stefan Gehr 2021-08-02 00:08:04 +02:00
parent e5cac912c1
commit 0539f0b515

View File

@ -145,6 +145,9 @@ fn controllers(config: &Config, filter: bool) -> std::io::Result<Vec<HwMon>> {
fn service(config: Config) -> std::io::Result<()> { fn service(config: Config) -> std::io::Result<()> {
let mut controllers = controllers(&config, true)?; let mut controllers = controllers(&config, true)?;
if controllers.len() < 1 {
return Err(not_found());
}
let mut cache = std::collections::HashMap::new(); let mut cache = std::collections::HashMap::new();
loop { loop {
for hw_mon in controllers.iter_mut() { for hw_mon in controllers.iter_mut() {