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

Method _reloadDatabase

rest/server_context.go:553–561  ·  view source on GitHub ↗

Removes and re-adds a database to the ServerContext.

(ctx context.Context, reloadDbName string, failFast bool, forceOnline bool)

Source from the content-addressed store, hash-verified

551
552// Removes and re-adds a database to the ServerContext.
553func (sc *ServerContext) _reloadDatabase(ctx context.Context, reloadDbName string, failFast bool, forceOnline bool) (*db.DatabaseContext, error) {
554 sc._unloadDatabase(ctx, reloadDbName)
555 config := sc._dbConfigs[reloadDbName]
556 return sc._getOrAddDatabaseFromConfig(ctx, config.DatabaseConfig, getOrAddDatabaseConfigOptions{
557 useExisting: true,
558 failFast: failFast,
559 forceOnline: forceOnline,
560 })
561}
562
563// Removes and re-adds a database to the ServerContext.
564func (sc *ServerContext) ReloadDatabase(ctx context.Context, reloadDbName string, forceOnline bool) (*db.DatabaseContext, error) {

Callers 1

ReloadDatabaseMethod · 0.95

Calls 2

_unloadDatabaseMethod · 0.95

Tested by

no test coverage detected