MCPcopy Index your code
hub / github.com/coder/coder / Close

Method Close

coderd/telemetry/telemetry.go:168–184  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166}
167
168func (r *remoteReporter) Close() {
169 r.closeMutex.Lock()
170 defer r.closeMutex.Unlock()
171 if r.isClosed() {
172 return
173 }
174 close(r.closed)
175 now := dbtime.Time(r.options.Clock.Now()).UTC()
176 r.shutdownAt = &now
177 if r.Enabled() {
178 // Report a final collection of telemetry prior to close!
179 // This could indicate final actions a user has taken, and
180 // the time the deployment was shutdown.
181 r.reportWithDeployment()
182 }
183 r.closeFunc()
184}
185
186func (r *remoteReporter) isClosed() bool {
187 select {

Callers

nothing calls this directly

Calls 6

isClosedMethod · 0.95
EnabledMethod · 0.95
reportWithDeploymentMethod · 0.95
TimeFunction · 0.92
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected