MCPcopy Create free account
hub / github.com/cloudbase/garm / TimeRemaining

Method TimeRemaining

params/github.go:390–397  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

388}
389
390func (a RunnerScaleSetSession) TimeRemaining() (time.Duration, error) {
391 exp, err := a.ExiresAt()
392 if err != nil {
393 return 0, fmt.Errorf("failed to get expiration: %w", err)
394 }
395 now := time.Now().UTC()
396 return exp.Sub(now), nil
397}
398
399func (a RunnerScaleSetSession) ExpiresIn(t time.Duration) bool {
400 remaining, err := a.TimeRemaining()

Callers 1

ExpiresInMethod · 0.95

Calls 1

ExiresAtMethod · 0.95

Tested by

no test coverage detected