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

Method _unloadDatabase

rest/server_context.go:1664–1673  ·  view source on GitHub ↗

_unloadDatabase unloads and stops the database, but does not remove the in-memory config.

(ctx context.Context, dbName string)

Source from the content-addressed store, hash-verified

1662
1663// _unloadDatabase unloads and stops the database, but does not remove the in-memory config.
1664func (sc *ServerContext) _unloadDatabase(ctx context.Context, dbName string) bool {
1665 dbCtx := sc._databases[dbName]
1666 if dbCtx == nil {
1667 return false
1668 }
1669 base.InfofCtx(ctx, base.KeyAll, "Closing db /%s (bucket %q)", base.MD(dbCtx.Name), base.MD(dbCtx.Bucket.GetName()))
1670 dbCtx.Close(ctx)
1671 delete(sc._databases, dbName)
1672 return true
1673}
1674
1675// _removeDatabase unloads and removes all references to the given database.
1676func (sc *ServerContext) _removeDatabase(ctx context.Context, dbName string) bool {

Callers 3

_reloadDatabaseMethod · 0.95
_removeDatabaseMethod · 0.95
_suspendDatabaseMethod · 0.95

Calls 4

InfofCtxFunction · 0.92
MDFunction · 0.92
GetNameMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected