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

Method ReloadDatabase

rest/server_context.go:564–569  ·  view source on GitHub ↗

Removes and re-adds a database to the ServerContext.

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

Source from the content-addressed store, hash-verified

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) {
565 // Obtain write lock during add database, to avoid race condition when creating based on ConfigServer
566 sc._databasesLock.Lock()
567 defer sc._databasesLock.Unlock()
568 return sc._reloadDatabase(ctx, reloadDbName, false, forceOnline)
569}
570
571func (sc *ServerContext) ReloadDatabaseWithConfig(nonContextStruct base.NonCancellableContext, config DatabaseConfig) error {
572 sc._databasesLock.Lock()

Callers 4

TakeDbOnlineMethod · 0.95
TestAllowConflictsConfigFunction · 0.80

Calls 3

_reloadDatabaseMethod · 0.95
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 3

TestAllowConflictsConfigFunction · 0.64