Also const assert how big MINIMUM_SESSIONS_TO_FETCH can be

This commit is contained in:
Eric Eastwood
2026-04-27 17:00:37 -05:00
parent 701da035f2
commit dacbf90224
+11
View File
@@ -651,6 +651,17 @@ const MINIMUM_SESSIONS_TO_FETCH: usize = {
min_sessions as usize
}
};
// This is a stop-gap to make people think about the downstream effects of updating
// `INACTIVE_SESSION_THRESHOLD` or whatever contributing factors go into
// `MINIMUM_SESSIONS_TO_FETCH`.
const _: () = {
assert!(
// Update this value if you're ok with the ammount of memory that could be used.
MINIMUM_SESSIONS_TO_FETCH == 2160,
"Sanity check that you're okay with `MINIMUM_SESSIONS_TO_FETCH` x 1 KiB when fetching sessions? \
(read the `MINIMUM_SESSIONS_TO_FETCH` docstring)"
);
};
/// Find the least recently used (LRU) compat sessions
///