MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / stopHTTPServers

Method stopHTTPServers

rest/server_context.go:304–316  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

302}
303
304func (sc *ServerContext) stopHTTPServers(ctx context.Context) {
305 sc._httpServersLock.Lock()
306 defer sc._httpServersLock.Unlock()
307 for _, s := range sc._httpServers {
308 if s.server != nil {
309 base.InfofCtx(ctx, base.KeyHTTP, "Closing HTTP Server: %v", s.addr)
310 if err := s.server.Close(); err != nil {
311 base.WarnfCtx(ctx, "Error closing HTTP server %q: %v", s.addr, err)
312 }
313 }
314 }
315 sc._httpServers = nil
316}
317
318// GetDatabase attempts to return the DatabaseContext of the database. It will load the database if necessary.
319func (sc *ServerContext) GetDatabase(ctx context.Context, name string) (*db.DatabaseContext, error) {

Callers 1

CloseMethod · 0.95

Calls 5

InfofCtxFunction · 0.92
WarnfCtxFunction · 0.92
CloseMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected