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

Method _reloadDatabaseWithConfig

rest/server_context.go:577–588  ·  view source on GitHub ↗
(ctx context.Context, config DatabaseConfig, failFast bool, loadFromBucket bool)

Source from the content-addressed store, hash-verified

575}
576
577func (sc *ServerContext) _reloadDatabaseWithConfig(ctx context.Context, config DatabaseConfig, failFast bool, loadFromBucket bool) error {
578 sc._removeDatabase(ctx, config.Name)
579 // use async initialization whenever using persistent config
580 asyncOnline := sc.persistentConfig
581 _, err := sc._getOrAddDatabaseFromConfig(ctx, config, getOrAddDatabaseConfigOptions{
582 useExisting: false,
583 failFast: failFast,
584 asyncOnline: asyncOnline,
585 loadFromBucket: loadFromBucket,
586 })
587 return err
588}
589
590// Adds a database to the ServerContext. Attempts a read after it gets the write
591// lock to see if it's already been added by another process. If so, returns either the

Calls 2

_removeDatabaseMethod · 0.95

Tested by

no test coverage detected