Better error for missing TopRatedsMetadata (#2860)
This commit is contained in:
parent
f8ad61e14a
commit
019c71a368
@ -312,7 +312,14 @@ where
|
|||||||
None => 0.0,
|
None => 0.0,
|
||||||
};
|
};
|
||||||
|
|
||||||
let avg_top_size = state.metadata::<TopRatedsMetadata>()?.map().len() as f64;
|
let avg_top_size =
|
||||||
|
match state.metadata::<TopRatedsMetadata>() {
|
||||||
|
Ok(m) => m.map().len() as f64,
|
||||||
|
Err(_) => return Err(Error::key_not_found(
|
||||||
|
"TopRatedsMetadata not found! You have to use Minimizer scheduler with this.",
|
||||||
|
)),
|
||||||
|
};
|
||||||
|
|
||||||
weight *= 1.0 + (tc_ref / avg_top_size);
|
weight *= 1.0 + (tc_ref / avg_top_size);
|
||||||
|
|
||||||
if favored {
|
if favored {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user