_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)
| 2046 | |
| 2047 | // _applyConfigs takes a map of dbName->DatabaseConfig and loads them into the ServerContext where necessary. |
| 2048 | func (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 | |
| 2063 | func (sc *ServerContext) applyConfigs(ctx context.Context, dbNameConfigs map[string]DatabaseConfig) (count int) { |
| 2064 | sc._databasesLock.Lock() |
no test coverage detected