MCPcopy Create free account
hub / github.com/Noumena-Network/code / needsLeaseRenewal

Function needsLeaseRenewal

src/auth/runtime/leases.ts:357–375  ·  view source on GitHub ↗
(
  lease: IssuedRuntimeLease,
  nowMs: number = Date.now(),
)

Source from the content-addressed store, hash-verified

355}
356
357export function needsLeaseRenewal(
358 lease: IssuedRuntimeLease,
359 nowMs: number = Date.now(),
360): boolean {
361 if (!lease.renewable) {
362 return false
363 }
364 if (
365 lease.state === 'expired' ||
366 lease.state === 'revoked' ||
367 lease.state === 'reauth_required'
368 ) {
369 return false
370 }
371 if (lease.renewAfter === null) {
372 return false
373 }
374 return nowMs >= lease.renewAfter
375}

Callers 3

leases.test.tsFile · 0.85
buildContinuityStateFunction · 0.85
buildLeaseRenewalStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected