MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / next_refresh_at_ms

Function next_refresh_at_ms

crates/openshell-server/src/provider_refresh.rs:249–264  ·  view source on GitHub ↗
(
    expires_at_ms: i64,
    refresh_before_seconds: i64,
    _max_lifetime_seconds: i64,
    _now_ms: i64,
)

Source from the content-addressed store, hash-verified

247}
248
249pub fn next_refresh_at_ms(
250 expires_at_ms: i64,
251 refresh_before_seconds: i64,
252 _max_lifetime_seconds: i64,
253 _now_ms: i64,
254) -> i64 {
255 let refresh_before_seconds = if refresh_before_seconds > 0 {
256 refresh_before_seconds
257 } else {
258 DEFAULT_REFRESH_BEFORE_SECONDS
259 };
260 if expires_at_ms > 0 {
261 return expires_at_ms.saturating_sub(refresh_before_seconds.saturating_mul(1000));
262 }
263 0
264}
265
266fn seconds_until_ms(now_ms: i64, target_ms: i64) -> i64 {
267 if target_ms <= 0 {

Callers 2

new_refresh_stateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected