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

Method Close

enterprise/coderd/coderd.go:817–840  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

815}
816
817func (api *API) Close() error {
818 // Replica manager should be closed first. This is because the replica
819 // manager updates the replica's table in the database when it closes.
820 // This tells other Coderds that it is now offline.
821 if api.replicaManager != nil {
822 _ = api.replicaManager.Close()
823 }
824 api.cancel()
825 if api.derpMesh != nil {
826 _ = api.derpMesh.Close()
827 }
828
829 if api.Options.CheckInactiveUsersCancelFunc != nil {
830 api.Options.CheckInactiveUsersCancelFunc()
831 }
832
833 // Close the connection logger to flush any remaining batched
834 // entries before shutting down the database connection.
835 if cl, ok := api.Options.ConnectionLogger.(io.Closer); ok {
836 _ = cl.Close()
837 }
838
839 return api.AGPL.Close()
840}
841
842func (api *API) updateEntitlements(ctx context.Context) error {
843 return api.Entitlements.Update(ctx, func(ctx context.Context) (codersdk.Entitlements, error) {

Callers 1

NewFunction · 0.95

Calls 2

CloseMethod · 0.65
cancelMethod · 0.45

Tested by

no test coverage detected