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

Method _applyConfigs

rest/config.go:2048–2061  ·  view source on GitHub ↗

_applyConfigs takes a map of dbName->DatabaseConfig and loads them into the ServerContext where necessary.

(ctx context.Context, dbNameConfigs map[string]DatabaseConfig, isInitialStartup bool, loadFromBucket bool)

Source from the content-addressed store, hash-verified

2046
2047// _applyConfigs takes a map of dbName->DatabaseConfig and loads them into the ServerContext where necessary.
2048func (sc *ServerContext) _applyConfigs(ctx context.Context, dbNameConfigs map[string]DatabaseConfig, isInitialStartup bool, loadFromBucket bool) (count int) {
2049 for dbName, cnf := range dbNameConfigs {
2050 applied, err := sc._applyConfig(base.NewNonCancelCtx(), cnf, true, isInitialStartup, loadFromBucket)
2051 if err != nil {
2052 base.ErrorfCtx(ctx, "Couldn't apply config for database %q: %v", base.MD(dbName), err)
2053 continue
2054 }
2055 if applied {
2056 count++
2057 }
2058 }
2059
2060 return count
2061}
2062
2063func (sc *ServerContext) applyConfigs(ctx context.Context, dbNameConfigs map[string]DatabaseConfig) (count int) {
2064 sc._databasesLock.Lock()

Callers 3

fetchAndLoadConfigsMethod · 0.95
_fetchAndLoadDatabaseMethod · 0.95
applyConfigsMethod · 0.95

Calls 4

_applyConfigMethod · 0.95
NewNonCancelCtxFunction · 0.92
ErrorfCtxFunction · 0.92
MDFunction · 0.92

Tested by

no test coverage detected