MCPcopy Create free account
hub / github.com/cli/cli / refreshLockState

Function refreshLockState

internal/config/refreshable_telemetry.go:92–103  ·  view source on GitHub ↗

refreshLockState classifies the error from acquiring the refresh lock for the refresh_lock dimension.

(lockErr error)

Source from the content-addressed store, hash-verified

90
91// refreshLockState classifies the error from acquiring the refresh lock for the refresh_lock dimension.
92func refreshLockState(lockErr error) string {
93 switch {
94 case lockErr == nil:
95 return refreshLockStateHeld
96 case isRefreshLockInaccessible(lockErr):
97 return refreshLockStateInaccessible
98 case errors.Is(lockErr, flock.ErrTimeout):
99 return refreshLockStateTimeout
100 default:
101 return refreshLockStateUnavailable
102 }
103}
104
105// refreshStorageErrorKind classifies a credential storage error for the storage_error dimension.
106func refreshStorageErrorKind(err error) string {

Callers 1

Calls 1

Tested by

no test coverage detected